diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-27 16:00:07 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-27 16:00:07 +0100 |
commit | 53434e44a95fe9334f4bdf5e0da987929addffb1 (patch) | |
tree | 75317dd53e6059b7c6fe0941312adc2e317c46eb /proto/static | |
parent | 3075824dbd4bb654e98614dfd9992ceec0428beb (diff) |
Better flushing of interfaces.
When device protocol goes down, interfaces should be flushed
asynchronously (in the same way like routes from protocols are flushed),
when protocol goes to DOWN/HUNGRY.
This fixes the problem with static routes staying in kernel routing
table after BIRD shutdown.
Diffstat (limited to 'proto/static')
-rw-r--r-- | proto/static/static.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/proto/static/static.c b/proto/static/static.c index c71d1da9..9308c59a 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -125,11 +125,12 @@ static_shutdown(struct proto *p) struct static_config *c = (void *) p->cf; struct static_route *r; - DBG("Static: prepare for landing!\n"); + /* Just reset the flag, the routes will be flushed by the nest */ WALK_LIST(r, c->iface_routes) - static_remove(p, r); + r->installed = 0; WALK_LIST(r, c->other_routes) - static_remove(p, r); + r->installed = 0; + return PS_DOWN; } @@ -294,7 +295,7 @@ static_show_rt(struct static_route *r) switch (r->dest) { case RTD_ROUTER: bsprintf(via, "via %I", r->via); break; - case RTD_DEVICE: bsprintf(via, "to %s", r->if_name); break; + case RTD_DEVICE: bsprintf(via, "dev %s", r->if_name); break; case RTD_BLACKHOLE: bsprintf(via, "blackhole"); break; case RTD_UNREACHABLE: bsprintf(via, "unreachable"); break; case RTD_PROHIBIT: bsprintf(via, "prohibited"); break; |