|
@@ -1632,19 +1632,16 @@ static int fib6_age(struct rt6_info *rt, void *arg)
|
|
|
|
|
|
static DEFINE_SPINLOCK(fib6_gc_lock);
|
|
|
|
|
|
-void fib6_run_gc(unsigned long expires, struct net *net)
|
|
|
+void fib6_run_gc(unsigned long expires, struct net *net, bool force)
|
|
|
{
|
|
|
- if (expires != ~0UL) {
|
|
|
+ if (force) {
|
|
|
spin_lock_bh(&fib6_gc_lock);
|
|
|
- gc_args.timeout = expires ? (int)expires :
|
|
|
- net->ipv6.sysctl.ip6_rt_gc_interval;
|
|
|
- } else {
|
|
|
- if (!spin_trylock_bh(&fib6_gc_lock)) {
|
|
|
- mod_timer(&net->ipv6.ip6_fib_timer, jiffies + HZ);
|
|
|
- return;
|
|
|
- }
|
|
|
- gc_args.timeout = net->ipv6.sysctl.ip6_rt_gc_interval;
|
|
|
+ } else if (!spin_trylock_bh(&fib6_gc_lock)) {
|
|
|
+ mod_timer(&net->ipv6.ip6_fib_timer, jiffies + HZ);
|
|
|
+ return;
|
|
|
}
|
|
|
+ gc_args.timeout = expires ? (int)expires :
|
|
|
+ net->ipv6.sysctl.ip6_rt_gc_interval;
|
|
|
|
|
|
gc_args.more = icmp6_dst_gc();
|
|
|
|
|
@@ -1661,7 +1658,7 @@ void fib6_run_gc(unsigned long expires, struct net *net)
|
|
|
|
|
|
static void fib6_gc_timer_cb(unsigned long arg)
|
|
|
{
|
|
|
- fib6_run_gc(0, (struct net *)arg);
|
|
|
+ fib6_run_gc(0, (struct net *)arg, true);
|
|
|
}
|
|
|
|
|
|
static int __net_init fib6_net_init(struct net *net)
|