From dfb899f465e0e112daf45ca5f9499aab27fcf524 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 18 Apr 2019 15:40:40 +0200 Subject: [PATCH] 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: 4c2862b9589c ('platform: add gretap tunnels support') --- src/platform/nm-platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 504d643197..1fc0ccb750 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -5374,7 +5374,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 */ @@ -5386,6 +5386,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) : "",