Routing table garbage collector gets really called.
This commit is contained in:
parent
0ba8a6147d
commit
2eca3b3a9c
1 changed files with 6 additions and 6 deletions
|
@ -324,12 +324,11 @@ rte_recalculate(rtable *table, net *net, struct proto *p, rte *new, ea_list *tmp
|
||||||
}
|
}
|
||||||
r->next = net->routes;
|
r->next = net->routes;
|
||||||
net->routes = r;
|
net->routes = r;
|
||||||
if (!r &&
|
}
|
||||||
table->gc_counter++ >= table->config->gc_max_ops &&
|
else if (table->gc_counter++ >= table->config->gc_max_ops &&
|
||||||
table->gc_time + table->config->gc_min_time <= now)
|
table->gc_time + table->config->gc_min_time <= now)
|
||||||
ev_schedule(table->gc_event);
|
ev_schedule(table->gc_event);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (new) /* Link in the new non-optimal route */
|
if (new) /* Link in the new non-optimal route */
|
||||||
{
|
{
|
||||||
new->next = old_best->next;
|
new->next = old_best->next;
|
||||||
|
@ -501,6 +500,7 @@ rt_setup(pool *p, rtable *t, char *name, struct rtable_config *cf)
|
||||||
t->gc_event = ev_new(p);
|
t->gc_event = ev_new(p);
|
||||||
t->gc_event->hook = rt_gc;
|
t->gc_event->hook = rt_gc;
|
||||||
t->gc_event->data = t;
|
t->gc_event->data = t;
|
||||||
|
t->gc_time = now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ again:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FIB_ITERATE_END(f);
|
FIB_ITERATE_END(f);
|
||||||
DBG("Pruned %d of %d routes and %d of %d networks\n", rcnt, rdel, ncnt, ndel);
|
DBG("Pruned %d of %d routes and %d of %d networks\n", rdel, rcnt, ndel, ncnt);
|
||||||
#ifdef DEBUGGING
|
#ifdef DEBUGGING
|
||||||
fib_check(&tab->fib);
|
fib_check(&tab->fib);
|
||||||
#endif
|
#endif
|
||||||
|
@ -574,7 +574,7 @@ rt_new_table(struct symbol *s)
|
||||||
cf_define_symbol(s, SYM_TABLE, c);
|
cf_define_symbol(s, SYM_TABLE, c);
|
||||||
c->name = s->name;
|
c->name = s->name;
|
||||||
add_tail(&new_config->tables, &c->n);
|
add_tail(&new_config->tables, &c->n);
|
||||||
c->gc_max_ops = 100;
|
c->gc_max_ops = 1000;
|
||||||
c->gc_min_time = 5;
|
c->gc_min_time = 5;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue