Commit c4e28de8 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Flush blackhole xroutes faster.

parent a413cb6d
...@@ -754,7 +754,9 @@ expire_routes(void) ...@@ -754,7 +754,9 @@ expire_routes(void)
i = 0; i = 0;
while(i < numxroutes) { while(i < numxroutes) {
struct xroute *xroute = &xroutes[i]; struct xroute *xroute = &xroutes[i];
if(xroute->time < now.tv_sec - xroute_gc_delay) { if(xroute->time < now.tv_sec - xroute_gc_delay ||
(xroute->cost >= INFINITY &&
xroute->time < now.tv_sec - xroute_hold_delay)) {
flush_xroute(xroute); flush_xroute(xroute);
continue; continue;
} }
......
...@@ -40,6 +40,7 @@ struct xroute myxroutes[MAXMYXROUTES]; ...@@ -40,6 +40,7 @@ struct xroute myxroutes[MAXMYXROUTES];
int nummyxroutes = 0; int nummyxroutes = 0;
int xroute_gc_delay = 180; int xroute_gc_delay = 180;
int xroute_hold_delay = 45;
static struct xroute * static struct xroute *
find_installed_xroute(unsigned char *prefix, unsigned short plen) find_installed_xroute(unsigned char *prefix, unsigned short plen)
......
...@@ -39,6 +39,7 @@ extern struct xroute myxroutes[MAXMYXROUTES]; ...@@ -39,6 +39,7 @@ extern struct xroute myxroutes[MAXMYXROUTES];
extern int nummyxroutes; extern int nummyxroutes;
extern int xroute_gc_delay; extern int xroute_gc_delay;
extern int xroute_hold_delay;
void install_xroute(struct xroute *xroute); void install_xroute(struct xroute *xroute);
void uninstall_xroute(struct xroute *xroute); void uninstall_xroute(struct xroute *xroute);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment