Skip to content

Commit 4ecbac8

Browse files
Mike Yuklassert
authored andcommitted
xfrm: Support crypto offload for inbound IPv4 UDP-encapsulated ESP packet
If xfrm_input() is called with UDP_ENCAP_ESPINUDP, the packet is already processed in UDP layer that removes the UDP header. Therefore, there should be no much difference to treat it as an ESP packet in the XFRM stack. Test: Enabled dir=in IPsec crypto offload, and verified IPv4 UDP-encapsulated ESP packets on both wifi/cellular network Signed-off-by: Mike Yu <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent a10fb4a commit 4ecbac8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/xfrm/xfrm_input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
471471
struct xfrm_offload *xo = xfrm_offload(skb);
472472
struct sec_path *sp;
473473

474-
if (encap_type < 0 || (xo && (xo->flags & XFRM_GRO || encap_type == 0))) {
474+
if (encap_type < 0 || (xo && (xo->flags & XFRM_GRO || encap_type == 0 ||
475+
encap_type == UDP_ENCAP_ESPINUDP))) {
475476
x = xfrm_input_state(skb);
476477

477478
if (unlikely(x->dir && x->dir != XFRM_SA_DIR_IN)) {

0 commit comments

Comments
 (0)