Skip to content

Commit

Permalink
gre: Fix MTU calculation for bound GRE tunnels
Browse files Browse the repository at this point in the history
The GRE header length should be subtracted when the tunnel MTU is
calculated.  This just corrects for the associativity change
introduced by commit 42aa916
("gre: Move MTU setting out of ipgre_tunnel_bind_dev").

Signed-off-by: Tom Goff <thomas.goff@boeing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tom Goff authored and David S. Miller committed Aug 14, 2009
1 parent 7c1d15d commit 8cdb045
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8cdb045

Please sign in to comment.