summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_input.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-06-07 10:38:47 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2023-06-12 10:36:48 +0200
commit842665a9008a53ff13ac22a4e4b8ae2f10e92aca (patch)
tree711d0d3e2b66cb1a3ddeff55d364a2051dd9770c /net/xfrm/xfrm_input.c
parentxfrm: fix inbound ipv4/udp/esp packets to UDPv6 dualstack sockets (diff)
downloadlinux-842665a9008a53ff13ac22a4e4b8ae2f10e92aca.tar.xz
linux-842665a9008a53ff13ac22a4e4b8ae2f10e92aca.zip
xfrm: Use xfrm_state selector for BEET input
For BEET the inner address and therefore family is stored in the xfrm_state selector. Use that when decapsulating an input packet instead of incorrectly relying on a non-existent tunnel protocol. Fixes: 5f24f41e8ea6 ("xfrm: Remove inner/outer modes from input path") Reported-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_input.c')
-rw-r--r--net/xfrm/xfrm_input.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index b731687b5f3e..815b38080401 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -331,11 +331,10 @@ xfrm_inner_mode_encap_remove(struct xfrm_state *x,
{
switch (x->props.mode) {
case XFRM_MODE_BEET:
- switch (XFRM_MODE_SKB_CB(skb)->protocol) {
- case IPPROTO_IPIP:
- case IPPROTO_BEETPH:
+ switch (x->sel.family) {
+ case AF_INET:
return xfrm4_remove_beet_encap(x, skb);
- case IPPROTO_IPV6:
+ case AF_INET6:
return xfrm6_remove_beet_encap(x, skb);
}
break;