* [PATCH iproute2] xfrm: also check for ipv6 state in xfrm_state_keep
@ 2020-04-27 7:14 Xin Long
2020-04-27 14:48 ` Andrea Claudi
2020-04-28 1:15 ` Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Xin Long @ 2020-04-27 7:14 UTC (permalink / raw)
To: network dev, stephen; +Cc: David Ahern, Xiumei Mu, aclaudi
As commit f9d696cf414c ("xfrm: not try to delete ipcomp states when using
deleteall") does, this patch is to fix the same issue for ip6 state where
xsinfo->id.proto == IPPROTO_IPV6.
# ip xfrm state add src 2000::1 dst 2000::2 spi 0x1000 \
proto comp comp deflate mode tunnel sel src 2000::1 dst \
2000::2 proto gre
# ip xfrm sta deleteall
Failed to send delete-all request
: Operation not permitted
Note that the xsinfo->proto in common states can never be IPPROTO_IPV6.
Fixes: f9d696cf414c ("xfrm: not try to delete ipcomp states when using deleteall")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
ip/xfrm_state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index d68f600..f4bf335 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -1131,7 +1131,8 @@ static int xfrm_state_keep(struct nlmsghdr *n, void *arg)
if (!xfrm_state_filter_match(xsinfo))
return 0;
- if (xsinfo->id.proto == IPPROTO_IPIP)
+ if (xsinfo->id.proto == IPPROTO_IPIP ||
+ xsinfo->id.proto == IPPROTO_IPV6)
return 0;
if (xb->offset > xb->size) {
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] xfrm: also check for ipv6 state in xfrm_state_keep
2020-04-27 7:14 [PATCH iproute2] xfrm: also check for ipv6 state in xfrm_state_keep Xin Long
@ 2020-04-27 14:48 ` Andrea Claudi
2020-04-28 1:15 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Andrea Claudi @ 2020-04-27 14:48 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, Stephen Hemminger, David Ahern, Xiumei Mu
On Mon, Apr 27, 2020 at 9:14 AM Xin Long <lucien.xin@gmail.com> wrote:
>
> As commit f9d696cf414c ("xfrm: not try to delete ipcomp states when using
> deleteall") does, this patch is to fix the same issue for ip6 state where
> xsinfo->id.proto == IPPROTO_IPV6.
>
> # ip xfrm state add src 2000::1 dst 2000::2 spi 0x1000 \
> proto comp comp deflate mode tunnel sel src 2000::1 dst \
> 2000::2 proto gre
> # ip xfrm sta deleteall
> Failed to send delete-all request
> : Operation not permitted
>
> Note that the xsinfo->proto in common states can never be IPPROTO_IPV6.
>
> Fixes: f9d696cf414c ("xfrm: not try to delete ipcomp states when using deleteall")
> Reported-by: Xiumei Mu <xmu@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> ip/xfrm_state.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
> index d68f600..f4bf335 100644
> --- a/ip/xfrm_state.c
> +++ b/ip/xfrm_state.c
> @@ -1131,7 +1131,8 @@ static int xfrm_state_keep(struct nlmsghdr *n, void *arg)
> if (!xfrm_state_filter_match(xsinfo))
> return 0;
>
> - if (xsinfo->id.proto == IPPROTO_IPIP)
> + if (xsinfo->id.proto == IPPROTO_IPIP ||
> + xsinfo->id.proto == IPPROTO_IPV6)
> return 0;
>
> if (xb->offset > xb->size) {
> --
> 2.1.0
>
LGTM.
Acked-by: Andrea Claudi <aclaudi@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] xfrm: also check for ipv6 state in xfrm_state_keep
2020-04-27 7:14 [PATCH iproute2] xfrm: also check for ipv6 state in xfrm_state_keep Xin Long
2020-04-27 14:48 ` Andrea Claudi
@ 2020-04-28 1:15 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2020-04-28 1:15 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, David Ahern, Xiumei Mu, aclaudi
On Mon, 27 Apr 2020 15:14:24 +0800
Xin Long <lucien.xin@gmail.com> wrote:
> As commit f9d696cf414c ("xfrm: not try to delete ipcomp states when using
> deleteall") does, this patch is to fix the same issue for ip6 state where
> xsinfo->id.proto == IPPROTO_IPV6.
>
> # ip xfrm state add src 2000::1 dst 2000::2 spi 0x1000 \
> proto comp comp deflate mode tunnel sel src 2000::1 dst \
> 2000::2 proto gre
> # ip xfrm sta deleteall
> Failed to send delete-all request
> : Operation not permitted
>
> Note that the xsinfo->proto in common states can never be IPPROTO_IPV6.
>
> Fixes: f9d696cf414c ("xfrm: not try to delete ipcomp states when using deleteall")
> Reported-by: Xiumei Mu <xmu@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-28 1:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 7:14 [PATCH iproute2] xfrm: also check for ipv6 state in xfrm_state_keep Xin Long
2020-04-27 14:48 ` Andrea Claudi
2020-04-28 1:15 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).