path: root/net/ipv6/xfrm6_mode_transport.c
diff options
authorSteffen Klassert <steffen.klassert@secunet.com>2017-02-15 09:40:00 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2017-02-15 11:04:11 +0100
commit7785bba299a8dc8fe8390a0183dad3cafb3f1d80 (patch)
tree33c29b31f0e66433b340998aa822bebe322aa116 /net/ipv6/xfrm6_mode_transport.c
parentxfrm: Extend the sec_path for IPsec offloading (diff)
esp: Add a software GRO codepath
This patch adds GRO ifrastructure and callbacks for ESP on ipv4 and ipv6. In case the GRO layer detects an ESP packet, the esp{4,6}_gro_receive() function does a xfrm state lookup and calls the xfrm input layer if it finds a matching state. The packet will be decapsulated and reinjected it into layer 2. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6/xfrm6_mode_transport.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_mode_transport.c b/net/ipv6/xfrm6_mode_transport.c
index 4e344105b3fd..4439ee44c8b0 100644
--- a/net/ipv6/xfrm6_mode_transport.c
+++ b/net/ipv6/xfrm6_mode_transport.c
@@ -47,6 +47,7 @@ static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb)
static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb)
int ihl = skb->data - skb_transport_header(skb);
+ struct xfrm_offload *xo = xfrm_offload(skb);
if (skb->transport_header != skb->network_header) {
@@ -55,7 +56,8 @@ static int xfrm6_transport_input(struct xfrm_state *x, struct sk_buff *skb)
ipv6_hdr(skb)->payload_len = htons(skb->len + ihl -
sizeof(struct ipv6hdr));
- skb_reset_transport_header(skb);
+ if (!xo || !(xo->flags & XFRM_GRO))
+ skb_reset_transport_header(skb);
return 0;