]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
link_gre6: Detect invalid encaplimit values
authorPhil Sutter <phil@nwl.cc>
Tue, 28 Nov 2017 15:49:58 +0000 (16:49 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 28 Nov 2017 17:48:13 +0000 (09:48 -0800)
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

index 50c1b804ceca784509d7ffc9b987827781d5b14e..0a82eaecf2cdd861b6b2401cbca3f36a293e8f00 100644 (file)
@@ -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;