From c4e28de8f9f79bc525cc97966836bd3fcb9cdacf Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 28 Jun 2007 21:13:43 +0200 Subject: [PATCH] Flush blackhole xroutes faster. --- babel.c | 4 +++- xroute.c | 1 + xroute.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/babel.c b/babel.c index db6a95a6..08641f8e 100644 --- a/babel.c +++ b/babel.c @@ -754,7 +754,9 @@ expire_routes(void) i = 0; while(i < numxroutes) { 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); continue; } diff --git a/xroute.c b/xroute.c index 17bca97a..4200ae65 100644 --- a/xroute.c +++ b/xroute.c @@ -40,6 +40,7 @@ struct xroute myxroutes[MAXMYXROUTES]; int nummyxroutes = 0; int xroute_gc_delay = 180; +int xroute_hold_delay = 45; static struct xroute * find_installed_xroute(unsigned char *prefix, unsigned short plen) diff --git a/xroute.h b/xroute.h index 34d17b89..1039da38 100644 --- a/xroute.h +++ b/xroute.h @@ -39,6 +39,7 @@ extern struct xroute myxroutes[MAXMYXROUTES]; extern int nummyxroutes; extern int xroute_gc_delay; +extern int xroute_hold_delay; void install_xroute(struct xroute *xroute); void uninstall_xroute(struct xroute *xroute);