ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
authorChangli Gao <xiaosuo@gmail.com>
Sat, 31 Jul 2010 13:25:08 +0000 (13:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Aug 2010 00:25:07 +0000 (17:25 -0700)
6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350 subtracts PPPOE_SES_HLEN from mtu at
the front of ip_fragment(). So the later subtraction should be removed. The
MTU of 802.1q is also 1500, so MTU should not be changed.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Bart De Schuymer <bdschuym@pandora.bo>
----
 net/ipv4/ip_output.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signed-off-by: Bart De Schuymer <bdschuym@pandora.bo>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c

index 6652bd9da676bbb83573de7f1156ead2658337ee..04b69896df5fc743021efd4d4a1705b7de146333 100644 (file)
@@ -446,7 +446,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
        int ptr;
        struct net_device *dev;
        struct sk_buff *skb2;
-       unsigned int mtu, hlen, left, len, ll_rs, pad;
+       unsigned int mtu, hlen, left, len, ll_rs;
        int offset;
        __be16 not_last_frag;
        struct rtable *rt = skb_rtable(skb);
@@ -585,9 +585,7 @@ slow_path:
        /* for bridged IP traffic encapsulated inside f.e. a vlan header,
         * we need to make room for the encapsulating header
         */
-       pad = nf_bridge_pad(skb);
-       ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, pad);
-       mtu -= pad;
+       ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, nf_bridge_pad(skb));
 
        /*
         *      Fragment the datagram.