From 1567edea8d3da7da08092eef15bb3bd4544c6464 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 26 Oct 2008 23:09:46 +0100 Subject: Bugfix for routing table breaking bug. Here is a patch fixing a bug that causes breakage of a local routing table during shutdown of Bird. The problem was caused by shutdown of 'device' protocol before shutdown of 'kernel' protocol. When 'device' protocol went down, the route (with local network prefix) From different protocol (BGP or OSPF) became preferred and installed to the kernel routing table. Such routes were broken (like 192.168.1.0/24 via 192.168.1.2). I think it is also the cause of problem reported by Martin Kraus. The patch disables updating of kernel routing table during shutdown of Bird. I am not sure whether this is the best way to fix it, I would prefer to forbid 'kernel' protocol to overwrite routes with 'proto kernel'. The patch also fixes a problem that during shutdown sometimes routes created by Bird remained in the kernel routing table. --- conf/conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'conf') diff --git a/conf/conf.c b/conf/conf.c index a744dca..fefcac5 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -266,7 +266,7 @@ config_commit(struct config *c) } if (old_config) /* Reconfiguration already in progress */ { - if (shutting_down) + if (shutting_down == 2) { log(L_INFO "New configuration discarded due to shutdown"); config_free(c); @@ -314,8 +314,9 @@ order_shutdown(void) init_list(&c->protos); init_list(&c->tables); c->shutdown = 1; - config_commit(c); shutting_down = 1; + config_commit(c); + shutting_down = 2; } /** -- cgit v1.2.3