From: Tom Herbert Date: Thu, 30 Oct 2014 15:40:56 +0000 (-0700) Subject: gre: Use inner mac length when computing tunnel length X-Git-Tag: submit/tizen/20160422.055611~1^2~99^2~11^2~318 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abe640984aa492652232b65d3579361cf6d461f5;p=sdk%2Femulator%2Femulator-kernel.git gre: Use inner mac length when computing tunnel length [ Upstream commit 14051f0452a2c26a3f4791e6ad6a435e8f1945ff ] 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. Signed-off-by: Tom Herbert Acked-by: Alexander Duyck Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c index 2d24f293f977..8c8493ea6b1c 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c @@ -50,7 +50,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;