Skip to content

Commit 842665a

Browse files
herbertxklassert
authored andcommitted
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: 5f24f41 ("xfrm: Remove inner/outer modes from input path") Reported-by: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 1166a53 commit 842665a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

net/xfrm/xfrm_input.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,10 @@ xfrm_inner_mode_encap_remove(struct xfrm_state *x,
331331
{
332332
switch (x->props.mode) {
333333
case XFRM_MODE_BEET:
334-
switch (XFRM_MODE_SKB_CB(skb)->protocol) {
335-
case IPPROTO_IPIP:
336-
case IPPROTO_BEETPH:
334+
switch (x->sel.family) {
335+
case AF_INET:
337336
return xfrm4_remove_beet_encap(x, skb);
338-
case IPPROTO_IPV6:
337+
case AF_INET6:
339338
return xfrm6_remove_beet_encap(x, skb);
340339
}
341340
break;

0 commit comments

Comments
 (0)