From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: [iproute PATCH] link_gre6: Detect invalid encaplimit values
Date: Tue, 28 Nov 2017 16:49:58 +0100 [thread overview]
Message-ID: <20171128154958.18403-1-phil@nwl.cc> (raw)
Looks like a typo: get_u8() returns 0 on success and -1 on error, so the
error checking here was ineffective.
Fixes: a11b7b71a6eba ("link_gre6: really support encaplimit option")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
ip/link_gre6.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index 50c1b804ceca7..0a82eaecf2cdd 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -372,7 +372,7 @@ get_failed:
} else {
__u8 uval;
- if (get_u8(&uval, *argv, 0) < -1)
+ if (get_u8(&uval, *argv, 0))
invarg("invalid ELIM", *argv);
encap_limit = uval;
flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT;
--
2.13.1
next reply other threads:[~2017-11-28 15:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 15:49 Phil Sutter [this message]
2017-11-30 13:02 ` [iproute PATCH] link_gre6: Detect invalid encaplimit values Nicolas Dichtel
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=20171128154958.18403-1-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netdev@vger.kernel.org \
--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