]> git.hungrycats.org Git - linux/commitdiff
[IPV4]: Fix rt_score() and usage when purging rtcache hash chains.
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Sat, 16 Aug 2003 05:08:52 +0000 (22:08 -0700)
committerStephen Hemminger <shemminger@osdl.org>
Sat, 16 Aug 2003 05:08:52 +0000 (22:08 -0700)
net/ipv4/route.c

index e60f43256f7ace048abec2c4052b0a2090ee9851..5ee3e309f4c8fdd81ee8f156c011dad571b36dd9 100644 (file)
@@ -463,7 +463,9 @@ out:        return ret;
  */
 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);
@@ -805,8 +807,7 @@ restart:
                 * 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);
                }