ipv4: avoid useless call of the function check_peer_pmtu
authorGao feng <gaofeng@cn.fujitsu.com>
Wed, 19 Oct 2011 15:34:09 +0000 (15:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Oct 2011 22:30:07 +0000 (18:30 -0400)
In func ipv4_dst_check,check_peer_pmtu should be called only when peer is updated.
So,if the peer is not updated in ip_rt_frag_needed,we can not inc __rt_peer_genid.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index 1082460daca7b5e9b81ca48be6a5172034a124cd..155138d8ec8bb9d7ef0e907b36b0725e0910394d 100644 (file)
@@ -1593,11 +1593,10 @@ unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph,
                        est_mtu = mtu;
                        peer->pmtu_learned = mtu;
                        peer->pmtu_expires = pmtu_expires;
+                       atomic_inc(&__rt_peer_genid);
                }
 
                inet_putpeer(peer);
-
-               atomic_inc(&__rt_peer_genid);
        }
        return est_mtu ? : new_mtu;
 }