netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] gre: Use inner mac length when computing tunnel length
@ 2014-10-30 15:40 Tom Herbert
  2014-10-30 15:52 ` Alexander Duyck
  2014-10-30 23:52 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Herbert @ 2014-10-30 15:40 UTC (permalink / raw)
  To: davem, alexander.duyck, netdev

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>
---
 net/ipv4/gre_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index f6e345c..bb5947b 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -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;
 
-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] gre: Use inner mac length when computing tunnel length
  2014-10-30 15:40 [PATCH net] gre: Use inner mac length when computing tunnel length Tom Herbert
@ 2014-10-30 15:52 ` Alexander Duyck
  2014-10-30 23:52 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Duyck @ 2014-10-30 15:52 UTC (permalink / raw)
  To: Tom Herbert, davem, alexander.duyck, netdev

On 10/30/2014 08:40 AM, Tom Herbert wrote:
> 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>
> ---
>   net/ipv4/gre_offload.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
> index f6e345c..bb5947b 100644
> --- a/net/ipv4/gre_offload.c
> +++ b/net/ipv4/gre_offload.c
> @@ -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.

Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] gre: Use inner mac length when computing tunnel length
  2014-10-30 15:40 [PATCH net] gre: Use inner mac length when computing tunnel length Tom Herbert
  2014-10-30 15:52 ` Alexander Duyck
@ 2014-10-30 23:52 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-10-30 23:52 UTC (permalink / raw)
  To: therbert; +Cc: alexander.duyck, netdev

From: Tom Herbert <therbert@google.com>
Date: Thu, 30 Oct 2014 08:40:56 -0700

> 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>

Applied and queued up for -stable.

Thanks everyone.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-30 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 15:40 [PATCH net] gre: Use inner mac length when computing tunnel length Tom Herbert
2014-10-30 15:52 ` Alexander Duyck
2014-10-30 23:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).