xfrm: Add encapsulation header offsets while SKB is not encrypted
authorIlan Tayari <ilant@mellanox.com>
Fri, 14 Apr 2017 08:07:39 +0000 (10:07 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 14 Apr 2017 08:07:39 +0000 (10:07 +0200)
commitf1bd7d659ef0ba0f18c6f6afe7bbbd2410acffa0
treeeb0c800ea60b7701158ad68bc566f514ac11f15d
parentf6e27114a60a0afdec40db1bf7f6da37b565745a
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>
net/ipv4/xfrm4_mode_transport.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/xfrm6_mode_transport.c
net/ipv6/xfrm6_mode_tunnel.c
net/xfrm/xfrm_output.c