netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] gre: Fix MTU sizing check for gretap tunnels
@ 2013-07-11 20:12 Alexander Duyck
  2013-07-11 21:52 ` Eric Dumazet
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexander Duyck @ 2013-07-11 20:12 UTC (permalink / raw)
  To: netdev; +Cc: pshelar, eric.dumazet, jesse, davem

This change fixes an MTU sizing issue seen with gretap tunnels when non-gso
packets are sent from the interface.

In my case I was able to reproduce the issue by simply sending a ping of
1421 bytes with the gretap interface created on a device with a standard
1500 mtu.

This fix is based on the fact that the tunnel mtu is already adjusted by
dev->hard_header_len so it would make sense that any packets being compared
against that mtu should also be adjusted by hard_header_len and the tunnel
header instead of just the tunnel header.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

 net/ipv4/ip_tunnel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 945734b..ca1cb2d 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -476,7 +476,7 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
 			    struct rtable *rt, __be16 df)
 {
 	struct ip_tunnel *tunnel = netdev_priv(dev);
-	int pkt_size = skb->len - tunnel->hlen;
+	int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len;
 	int mtu;
 
 	if (df)

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

end of thread, other threads:[~2013-07-12  1:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11 20:12 [PATCH net] gre: Fix MTU sizing check for gretap tunnels Alexander Duyck
2013-07-11 21:52 ` Eric Dumazet
2013-07-11 23:30   ` David Miller
2013-07-11 22:24 ` Pravin Shelar
2013-07-11 22:45   ` Eric Dumazet
2013-07-11 23:19     ` Pravin Shelar
2013-07-11 23:30       ` David Miller
2013-07-11 23:36       ` Jesse Gross
2013-07-12  0:13         ` Alexander Duyck
2013-07-12  1:11 ` Cong Wang

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