Skip to content

Commit

Permalink
ipv6: use timer pending
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jul 21, 2008
1 parent 3a33cc1 commit 847499c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,17 +661,17 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,

static __inline__ void fib6_start_gc(struct net *net, struct rt6_info *rt)
{
if (net->ipv6.ip6_fib_timer->expires == 0 &&
if (!timer_pending(net->ipv6.ip6_fib_timer) &&
(rt->rt6i_flags & (RTF_EXPIRES|RTF_CACHE)))
mod_timer(net->ipv6.ip6_fib_timer, jiffies +
net->ipv6.sysctl.ip6_rt_gc_interval);
mod_timer(net->ipv6.ip6_fib_timer,
jiffies + net->ipv6.sysctl.ip6_rt_gc_interval);
}

void fib6_force_start_gc(struct net *net)
{
if (net->ipv6.ip6_fib_timer->expires == 0)
mod_timer(net->ipv6.ip6_fib_timer, jiffies +
net->ipv6.sysctl.ip6_rt_gc_interval);
if (!timer_pending(net->ipv6.ip6_fib_timer))
mod_timer(net->ipv6.ip6_fib_timer,
jiffies + net->ipv6.sysctl.ip6_rt_gc_interval);
}

/*
Expand Down

0 comments on commit 847499c

Please sign in to comment.