link_gre6: Detect invalid encaplimit values

Looks like a typo: get_u8() returns 0 on success and -1 on error, so the
error checking here was ineffective.

Fixes: a11b7b71a6 ("link_gre6: really support encaplimit option")
Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2017-11-28 16:49:58 +01:00 committed by Stephen Hemminger
parent c6a656f4f9
commit 56708ae7c9
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ get_failed:
} else { } else {
__u8 uval; __u8 uval;
if (get_u8(&uval, *argv, 0) < -1) if (get_u8(&uval, *argv, 0))
invarg("invalid ELIM", *argv); invarg("invalid ELIM", *argv);
encap_limit = uval; encap_limit = uval;
flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT; flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT;