gre: Fix MTU calculation for bound GRE tunnels
authorTom Goff <thomas.goff@boeing.com>
Fri, 14 Aug 2009 23:33:56 +0000 (16:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Aug 2009 23:41:18 +0000 (16:41 -0700)
The GRE header length should be subtracted when the tunnel MTU is
calculated.  This just corrects for the associativity change
introduced by commit 42aa916265d740d66ac1f17290366e9494c884c2
("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>
net/ipv4/ip_gre.c

index cb4a0f4bd5e5654b465ddee4f32a42504711d5d3..82c11dd10a628947e1486e300918acd848e0d718 100644 (file)
@@ -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;