]> git.ipfire.org Git - thirdparty/iproute2.git/commit
xfrm: also check for ipv6 state in xfrm_state_keep
authorXin Long <lucien.xin@gmail.com>
Mon, 27 Apr 2020 07:14:24 +0000 (15:14 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 27 Apr 2020 21:50:37 +0000 (14:50 -0700)
commitd27fc6390ce32ecdba6324e22b1c341791c5c63f
tree5fe61698b8a7c44ea835124039f8492645cd425a
parent0149dabf2a1bad2f210ca2d987b29083247b7bd0
xfrm: also check for ipv6 state in xfrm_state_keep

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>
Acked-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/xfrm_state.c