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/a650221ae500f0c7cf496c61c96c1b103dcb6f67.camel@redhat.com Reported-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent c319882 commit 773bb76

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)