Skip to content

Commit 773bb76

Browse files
rleonklassert
authored andcommitted
xfrm: Allow UDP encapsulation only in offload modes
The missing check of x->encap caused to the situation where GSO packets were created with UDP encapsulation. As a solution return the encap check for non-offloaded SA. Fixes: 983a73d ("xfrm: Pass UDP encapsulation in TX packet offload") Closes: https://lore.kernel.org/all/[email protected] Reported-by: Paolo Abeni <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent c319882 commit 773bb76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/xfrm/xfrm_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
407407
struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
408408
struct net_device *dev = x->xso.dev;
409409

410-
if (!x->type_offload)
410+
if (!x->type_offload ||
411+
(x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED && x->encap))
411412
return false;
412413

413414
if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET ||

0 commit comments

Comments
 (0)