Skip to content

Commit

Permalink
gre: Use inner mac length when computing tunnel length
Browse files Browse the repository at this point in the history
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 <therbert@google.com>
Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tom Herbert authored and David S. Miller committed Oct 30, 2014
1 parent 292dd65 commit 14051f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/gre_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 14051f0

Please sign in to comment.