naccyde / rpms / iproute

Forked from rpms/iproute 8 months ago
Clone

Blame SOURCES/0013-xfrm-also-check-for-ipv6-state-in-xfrm_state_keep.patch

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