aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_output.c
diff options
context:
space:
mode:
authorIlan Tayari <ilant@mellanox.com>2017-04-14 04:07:39 -0400
committerSteffen Klassert <steffen.klassert@secunet.com>2017-04-14 04:07:39 -0400
commitf1bd7d659ef0ba0f18c6f6afe7bbbd2410acffa0 (patch)
treeeb0c800ea60b7701158ad68bc566f514ac11f15d /net/xfrm/xfrm_output.c
parentf6e27114a60a0afdec40db1bf7f6da37b565745a (diff)
xfrm: Add encapsulation header offsets while SKB is not encrypted
Both esp4 and esp6 used to assume that the SKB payload is encrypted and therefore the inner_network and inner_transport offsets are not relevant. When doing crypto offload in the NIC, this is no longer the case and the NIC driver needs these offsets so it can do TX TCP checksum offloading. This patch sets the inner_network and inner_transport members of the SKB, as well as encapsulation, to reflect the actual positions of these headers, and removes them only once encryption is done on the payload. Signed-off-by: Ilan Tayari <ilant@mellanox.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r--net/xfrm/xfrm_output.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index a15088613a6c..8c0b6722aaa8 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -205,6 +205,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
205 int err; 205 int err;
206 206
207 secpath_reset(skb); 207 secpath_reset(skb);
208 skb->encapsulation = 0;
208 209
209 if (xfrm_dev_offload_ok(skb, x)) { 210 if (xfrm_dev_offload_ok(skb, x)) {
210 struct sec_path *sp; 211 struct sec_path *sp;
@@ -218,6 +219,7 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
218 if (skb->sp) 219 if (skb->sp)
219 secpath_put(skb->sp); 220 secpath_put(skb->sp);
220 skb->sp = sp; 221 skb->sp = sp;
222 skb->encapsulation = 1;
221 223
222 sp->olen++; 224 sp->olen++;
223 sp->xvec[skb->sp->len++] = x; 225 sp->xvec[skb->sp->len++] = x;