Patchwork ipv4: avoid useless call of the function check_peer_pmtu

login
register
mail settings
Submitter Gao feng
Date Oct. 20, 2011, 1:34 a.m.
Message ID <1319074449-10892-1-git-send-email-gaofeng@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/120720/
State Accepted
Delegated to: David Miller
Headers show

Comments

Gao feng - Oct. 20, 2011, 1:34 a.m.
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>
---
 net/ipv4/route.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Eric Dumazet - Oct. 20, 2011, 4:30 a.m.
Le jeudi 20 octobre 2011 à 09:34 +0800, Gao feng a écrit :
> 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>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 075212e..04a14db 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1568,11 +1568,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;
 }