diff options
author | Leon Romanovsky <[email protected]> | 2024-03-12 13:55:22 +0200 |
---|---|---|
committer | Steffen Klassert <[email protected]> | 2024-03-18 11:56:11 +0100 |
commit | 773bb766ca4a05bf363203030b72b10088869224 (patch) | |
tree | 5ac14da356f666a2535d17f29b6b5ff4bdb13f71 | |
parent | c3198822c6cb9fb588e446540485669cc81c5d34 (diff) |
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: 983a73da1f99 ("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]>
-rw-r--r-- | net/xfrm/xfrm_device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c index 653e51ae3964..6346690d5c69 100644 --- a/net/xfrm/xfrm_device.c +++ b/net/xfrm/xfrm_device.c @@ -407,7 +407,8 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x) struct xfrm_dst *xdst = (struct xfrm_dst *)dst; struct net_device *dev = x->xso.dev; - if (!x->type_offload) + if (!x->type_offload || + (x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED && x->encap)) return false; if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET || |