Commit 400293d3 authored by Thomas Haller's avatar Thomas Haller

platform: fix nm_platform_lnk_gre_to_string() for tap links

Why didn't we get a compiler warning about this bug?
At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns:

    CC       src/platform/src_libNetworkManagerBase_la-nm-platform.lo
  ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
                      lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
                      ^

Fixes: 4c2862b9 ('platform: add gretap tunnels support')
(cherry picked from commit dfb899f4)
(cherry picked from commit ed88c71f)
parent 8190a68c
Pipeline #31719 failed with stage
in 26 minutes and 33 seconds
......@@ -5276,7 +5276,7 @@ nm_platform_lnk_gre_to_string (const NMPlatformLnkGre *lnk, char *buf, gsize len
return buf;
g_snprintf (buf, len,
lnk->is_tap ? "gretap" : "gre"
"gre%s" /* is_tap */
"%s" /* remote */
"%s" /* local */
"%s" /* parent_ifindex */
......@@ -5288,6 +5288,7 @@ nm_platform_lnk_gre_to_string (const NMPlatformLnkGre *lnk, char *buf, gsize len
"%s" /* ikey */
"%s" /* okey */
"",
lnk->is_tap ? "tap" : "",
lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
lnk->local ? nm_sprintf_buf (str_local, " local %s", nm_utils_inet4_ntop (lnk->local, str_local1)) : "",
lnk->parent_ifindex ? nm_sprintf_buf (str_parent_ifindex, " dev %d", lnk->parent_ifindex) : "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment