Skip to contentSkip to conversation

link_gre6: Detect invalid encaplimit values

PATCH In review Phil Sutter 2 participants 2 messages Nov 28, 2017 – Nov 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 a11b7b71a6eba ("link_gre6: really support encaplimit option")
---
 ip/link_gre6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/link_gre6.c +1 -1
index 50c1b804ceca7..0a82eaecf2cdd 100644
@@ -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;
Signature · 1 line
2.13.1