OSDN Git Service

ipv6: use timer pending
authorStephen Hemminger <shemminger@vyatta.com>
Mon, 21 Jul 2008 20:21:35 +0000 (13:21 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 6 Sep 2008 11:35:24 +0000 (13:35 +0200)
[backport of 2.6 commit 847499ce71bdcc8fc542062df6ebed3e596608dd]

This fixes the bridge reference count problem and cleanups ipv6 FIB
timer management.  Don't use expires field, because it is not a proper
way to test, instead use timer_pending().

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv6/ip6_fib.c

index 9c7bff5..45c29bd 100644 (file)
@@ -495,7 +495,7 @@ out:
 
 static __inline__ void fib6_start_gc(struct rt6_info *rt)
 {
-       if (ip6_fib_timer.expires == 0 &&
+       if (!timer_pending(&ip6_fib_timer) &&
            (rt->rt6i_flags & (RTF_EXPIRES|RTF_CACHE)))
                mod_timer(&ip6_fib_timer, jiffies + ip6_rt_gc_interval);
 }