|
|
d8fb9e |
From 98ad13988375d240d6446954355da9622b87f1c1 Mon Sep 17 00:00:00 2001
|
|
|
d8fb9e |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
d8fb9e |
Date: Thu, 30 Apr 2020 19:50:12 +0200
|
|
|
d8fb9e |
Subject: [PATCH] xfrm: also check for ipv6 state in xfrm_state_keep
|
|
|
d8fb9e |
|
|
|
d8fb9e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1828034
|
|
|
d8fb9e |
Upstream Status: iproute2.git commit d27fc6390ce32
|
|
|
d8fb9e |
|
|
|
d8fb9e |
commit d27fc6390ce32ecdba6324e22b1c341791c5c63f
|
|
|
d8fb9e |
Author: Xin Long <lucien.xin@gmail.com>
|
|
|
d8fb9e |
Date: Mon Apr 27 15:14:24 2020 +0800
|
|
|
d8fb9e |
|
|
|
d8fb9e |
xfrm: also check for ipv6 state in xfrm_state_keep
|
|
|
d8fb9e |
|
|
|
d8fb9e |
As commit f9d696cf414c ("xfrm: not try to delete ipcomp states when using
|
|
|
d8fb9e |
deleteall") does, this patch is to fix the same issue for ip6 state where
|
|
|
d8fb9e |
xsinfo->id.proto == IPPROTO_IPV6.
|
|
|
d8fb9e |
|
|
|
d8fb9e |
# ip xfrm state add src 2000::1 dst 2000::2 spi 0x1000 \
|
|
|
d8fb9e |
proto comp comp deflate mode tunnel sel src 2000::1 dst \
|
|
|
d8fb9e |
2000::2 proto gre
|
|
|
d8fb9e |
# ip xfrm sta deleteall
|
|
|
d8fb9e |
Failed to send delete-all request
|
|
|
d8fb9e |
: Operation not permitted
|
|
|
d8fb9e |
|
|
|
d8fb9e |
Note that the xsinfo->proto in common states can never be IPPROTO_IPV6.
|
|
|
d8fb9e |
|
|
|
d8fb9e |
Fixes: f9d696cf414c ("xfrm: not try to delete ipcomp states when using deleteall")
|
|
|
d8fb9e |
Reported-by: Xiumei Mu <xmu@redhat.com>
|
|
|
d8fb9e |
Signed-off-by: Xin Long <lucien.xin@gmail.com>
|
|
|
d8fb9e |
Acked-by: Andrea Claudi <aclaudi@redhat.com>
|
|
|
d8fb9e |
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
|
d8fb9e |
---
|
|
|
d8fb9e |
ip/xfrm_state.c | 3 ++-
|
|
|
d8fb9e |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
d8fb9e |
|
|
|
d8fb9e |
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
|
|
|
d8fb9e |
index 8baa0eb669969..e0e24b0618294 100644
|
|
|
d8fb9e |
--- a/ip/xfrm_state.c
|
|
|
d8fb9e |
+++ b/ip/xfrm_state.c
|
|
|
d8fb9e |
@@ -1048,7 +1048,8 @@ static int xfrm_state_keep(const struct sockaddr_nl *who,
|
|
|
d8fb9e |
if (!xfrm_state_filter_match(xsinfo))
|
|
|
d8fb9e |
return 0;
|
|
|
d8fb9e |
|
|
|
d8fb9e |
- if (xsinfo->id.proto == IPPROTO_IPIP)
|
|
|
d8fb9e |
+ if (xsinfo->id.proto == IPPROTO_IPIP ||
|
|
|
d8fb9e |
+ xsinfo->id.proto == IPPROTO_IPV6)
|
|
|
d8fb9e |
return 0;
|
|
|
d8fb9e |
|
|
|
d8fb9e |
if (xb->offset > xb->size) {
|
|
|
d8fb9e |
--
|
|
|
d8fb9e |
2.25.4
|
|
|
d8fb9e |
|