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 /nest/proto.c | |
parent | 3075824dbd4bb654e98614dfd9992ceec0428beb (diff) | |
download | bird-53434e44a95fe9334f4bdf5e0da987929addffb1.tar bird-53434e44a95fe9334f4bdf5e0da987929addffb1.zip |
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 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nest/proto.c b/nest/proto.c index db6bf9b..78fca99 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -740,6 +740,8 @@ proto_notify_state(struct proto *p, unsigned ps) } } +extern struct protocol proto_unix_iface; + static void proto_flush_all(void *unused UNUSED) { @@ -748,6 +750,11 @@ proto_flush_all(void *unused UNUSED) rt_prune_all(); while ((p = HEAD(flush_proto_list))->n.next) { + /* This will flush interfaces in the same manner + like rt_prune_all() flushes routes */ + if (p->proto == &proto_unix_iface) + if_flush_ifaces(p); + DBG("Flushing protocol %s\n", p->name); p->core_state = FS_HUNGRY; proto_relink(p); |