From: Daniel Borkmann <daniel@iogearbox.net>
To: stephen@networkplumber.org
Cc: phil@nwl.cc, netdev@vger.kernel.org,
Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH iproute2] ip, route: fix minor compile warning
Date: Mon, 14 Dec 2015 16:34:29 +0100 [thread overview]
Message-ID: <c43f41f31854bb0a27cc6cd6d9e465a28a94ffb9.1450106992.git.daniel@iogearbox.net> (raw)
Seems like gcc (4.8.3) doesn't catch this false positive, triggering
after 0f7543322c5f ("route: ignore RTAX_HOPLIMIT of value -1"):
iproute.c: In function 'print_route':
iproute.c:301:12: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
features &= ~RTAX_FEATURE_ECN;
^
iproute.c:575:10: note: 'val' was declared here
__u32 val;
^
So just shut it up by initializing to 0.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
ip/iproute.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index c42ea0b..867c8da 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -572,7 +572,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
mxlock = *(unsigned*)RTA_DATA(mxrta[RTAX_LOCK]);
for (i=2; i<= RTAX_MAX; i++) {
- __u32 val;
+ __u32 val = 0;
if (mxrta[i] == NULL)
continue;
--
1.9.3
next reply other threads:[~2015-12-14 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 15:34 Daniel Borkmann [this message]
2015-12-14 15:51 ` [PATCH iproute2] ip, route: fix minor compile warning Phil Sutter
2015-12-14 15:53 ` Daniel Borkmann
2015-12-18 1:12 ` Stephen Hemminger
2015-12-18 9:18 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c43f41f31854bb0a27cc6cd6d9e465a28a94ffb9.1450106992.git.daniel@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=phil@nwl.cc \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).