patch-2.4.23 linux-2.4.23/net/ipv4/route.c

Next file: linux-2.4.23/net/ipv4/tcp_input.c
Previous file: linux-2.4.23/net/ipv4/netfilter/ipt_unclean.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/net/ipv4/route.c linux-2.4.23/net/ipv4/route.c
@@ -375,7 +375,9 @@
  */
 static inline u32 rt_score(struct rtable *rt)
 {
-	u32 score = rt->u.dst.__use;
+	u32 score = jiffies - rt->u.dst.lastuse;
+
+	score = ~score & ~(3<<30);
 
 	if (rt_valuable(rt))
 		score |= (1<<31);
@@ -703,8 +705,7 @@
 		 * The second limit is less certain. At the moment it allows
 		 * only 2 entries per bucket. We will see.
 		 */
-		if (chain_length > ip_rt_gc_elasticity ||
-		    (chain_length > 1 && !(min_score & (1<<31)))) {
+		if (chain_length > ip_rt_gc_elasticity) {
 			*candp = cand->u.rt_next;
 			rt_free(cand);
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)