gre: Use inner mac length when computing tunnel length
Subsystems (2)
PATCH 1/1 gre: Use inner mac length when computing tunnel length
Currently, skb_inner_network_header is used but this does not account for Ethernet header for ETH_P_TEB. Use skb_inner_mac_header which handles TEB and also should work with IP encapsulation in which case inner mac and inner network headers are the same.
Tested: Ran TCP_STREAM over GRE, worked as expected.
--- net/ipv4/gre_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/gre_offload.c +1 -1
@@ -47,7 +47,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, greh = (struct gre_base_hdr *)skb_transport_header (skb); - ghl =skb_inner_network_header (skb) -skb_transport_header (skb); + ghl =skb_inner_mac_header (skb) -skb_transport_header (skb);if (unlikely (ghl <sizeof (*greh))) goto out;
Signature · 1 line
2.1.0.rc2.206.gedb03e5
Quoted 18 lines · Tom Herbert
Currently,
skb_inner_network_headeris used but this does not account for Ethernet header forETH_P_TEB. Useskb_inner_mac_headerwhich handles TEB and also should work with IP encapsulation in which case inner mac and inner network headers are the same.Tested: Ran
TCP_STREAMover GRE, worked as expected.Signed-off-by Tom Herbert <[email protected]>--- net/ipv4/gre_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv4/gre_offload.c +0
-0
net/ipv4/gre_offload.c static struct sk_buff *gre_gso_segment(struct sk_buff *skb, · line 53
Quoted 8 lines
net/ipv4/gre_offload.c +1
-1@@ -47,7 +47,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, greh = (struct gre_base_hdr *)skb_transport_header (skb); - ghl =skb_inner_network_header (skb) -skb_transport_header (skb); + ghl =skb_inner_mac_header (skb) -skb_transport_header (skb);if (unlikely (ghl <sizeof (*greh))) goto out;
This works for me. We probably need to queue this up for stable as well since this bug goes back as far as 3.14.
David Miller
maintainerFrom: Tom Herbert <[email protected]>
Date: Thu, 30 Oct 2014 08:40:56 -0700
Quoted 8 lines
Currently,
skb_inner_network_headeris used but this does not account for Ethernet header forETH_P_TEB. Useskb_inner_mac_headerwhich handles TEB and also should work with IP encapsulation in which case inner mac and inner network headers are the same.Tested: Ran
TCP_STREAMover GRE, worked as expected.Signed-off-by Tom Herbert <[email protected]>
Applied and queued up for -stable.
Thanks everyone.