Skip to contentSkip to conversation

gre: Fix MTU calculation for bound GRE tunnels

PATCH In review Tom Goff 2 participants 2 messages Aug 14, 2009

Subsystems (3)
lore
Share & tools
lore

Tom Goff

author
#0 lore raw

PATCH 1/1 gre: Fix MTU calculation for bound GRE tunnels

The GRE header length should be subtracted when the tunnel MTU is calculated. This just corrects for the associativity change introduced by commit 42aa916265d740d66ac1f17290366e9494c884c2.

---
 net/ipv4/ip_gre.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/ip_gre.c +1 -1
index cb4a0f4..82c11dd 100644
@@ -951,7 +951,7 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev)
 			addend += 4;
 	}
 	dev->needed_headroom = addend + hlen;
-	mtu -= dev->hard_header_len - addend;
+	mtu -= dev->hard_header_len + addend;
 
 	if (mtu < 68)
 		mtu = 68;
Signature · 1 line
1.6.0.6
maintainer
#1 lore raw

From: Tom Goff <[email protected]>
Date: Fri, 14 Aug 2009 11:37:58 -0700

Quoted 5 lines

The GRE header length should be subtracted when the tunnel MTU is calculated. This just corrects for the associativity change introduced by commit 42aa916265d740d66ac1f17290366e9494c884c2.

Thanks for finding and fixing this bug, applied.