naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0040-link_gre6-Detect-invalid-encaplimit-values.patch

36cfb7
From 90a1430fca8d5165e1909de9f009aa9f4d6430ef Mon Sep 17 00:00:00 2001
36cfb7
From: Phil Sutter <psutter@redhat.com>
36cfb7
Date: Wed, 29 Nov 2017 18:36:17 +0100
36cfb7
Subject: [PATCH] link_gre6: Detect invalid encaplimit values
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1459600
36cfb7
Upstream Status: iproute2.git commit 56708ae7c9535
36cfb7
36cfb7
commit 56708ae7c9535859223c5b68097b35bf0fae677c
36cfb7
Author: Phil Sutter <phil@nwl.cc>
36cfb7
Date:   Tue Nov 28 16:49:58 2017 +0100
36cfb7
36cfb7
    link_gre6: Detect invalid encaplimit values
36cfb7
36cfb7
    Looks like a typo: get_u8() returns 0 on success and -1 on error, so the
36cfb7
    error checking here was ineffective.
36cfb7
36cfb7
    Fixes: a11b7b71a6eba ("link_gre6: really support encaplimit option")
36cfb7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
36cfb7
---
36cfb7
 ip/link_gre6.c | 2 +-
36cfb7
 1 file changed, 1 insertion(+), 1 deletion(-)
36cfb7
36cfb7
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
e138d9
index 932f9ee96124d..a9d18ee954641 100644
36cfb7
--- a/ip/link_gre6.c
36cfb7
+++ b/ip/link_gre6.c
36cfb7
@@ -351,7 +351,7 @@ get_failed:
36cfb7
 			} else {
36cfb7
 				__u8 uval;
36cfb7
 
36cfb7
-				if (get_u8(&uval, *argv, 0) < -1)
36cfb7
+				if (get_u8(&uval, *argv, 0))
36cfb7
 					invarg("invalid ELIM", *argv);
36cfb7
 				encap_limit = uval;
36cfb7
 				flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT;
36cfb7
-- 
e138d9
2.21.0
36cfb7