aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/esp4_offload.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2022-03-07 13:11:41 +0100
committerSteffen Klassert <steffen.klassert@secunet.com>2022-03-07 13:14:04 +0100
commit23c7f8d7989e1646aac82f75761b7648c355cb8a (patch)
tree3a2cce55445d12ac2ed9131bf45a518b1a999bfd /net/ipv4/esp4_offload.c
parentesp: Fix BEET mode inter address family tunneling on GSO (diff)
downloadlinux-dev-23c7f8d7989e1646aac82f75761b7648c355cb8a.tar.xz
linux-dev-23c7f8d7989e1646aac82f75761b7648c355cb8a.zip
net: Fix esp GSO on inter address family tunnels.
The esp tunnel GSO handlers use skb_mac_gso_segment to push the inner packet to the segmentation handlers. However, skb_mac_gso_segment takes the Ethernet Protocol ID from 'skb->protocol' which is wrong for inter address family tunnels. We fix this by introducing a new skb_eth_gso_segment function. This function can be used if it is necessary to pass the Ethernet Protocol ID directly to the segmentation handler. First users of this function will be the esp4 and esp6 tunnel segmentation handlers. Fixes: c35fe4106b92 ("xfrm: Add mode handlers for IPsec on layer 2") Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv4/esp4_offload.c')
-rw-r--r--net/ipv4/esp4_offload.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 146d4d54830c..935026f4c807 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -110,8 +110,7 @@ static struct sk_buff *xfrm4_tunnel_gso_segment(struct xfrm_state *x,
struct sk_buff *skb,
netdev_features_t features)
{
- __skb_push(skb, skb->mac_len);
- return skb_mac_gso_segment(skb, features);
+ return skb_eth_gso_segment(skb, features, htons(ETH_P_IP));
}
static struct sk_buff *xfrm4_transport_gso_segment(struct xfrm_state *x,