summaryrefslogtreecommitdiffstats
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-12-14 01:32:37 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-12-14 01:32:37 +0100
commit8a7fb8858fa87bce6f2f15ee2bbb77704b5fff4e (patch)
tree9d4ca182afc0d2f140afeb9d60ef5668776eb9d5 /nest/rt-table.c
parent28008482a97c0ac70e648759fe37bad0633ed9f7 (diff)
downloadbird-8a7fb8858fa87bce6f2f15ee2bbb77704b5fff4e.tar
bird-8a7fb8858fa87bce6f2f15ee2bbb77704b5fff4e.zip
Finishes 'route reload' feature.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 8efc0a6..df2834a 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -165,6 +165,8 @@ do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old,
rte *old0 = old;
int ok;
+ int fast_exit_hack = 0;
+
if (new)
{
p->stats.exp_updates_received++;
@@ -174,6 +176,7 @@ do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old,
{
p->stats.exp_updates_rejected++;
drop_reason = "out of scope";
+ fast_exit_hack = 1;
}
else if ((ok = p->import_control ? p->import_control(p, &new, &tmpa, rte_update_pool) : 0) < 0)
{
@@ -199,6 +202,11 @@ do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old,
else
p->stats.exp_withdraws_received++;
+ /* Hack: This is here to prevent 'spurious withdraws'
+ for loopback addresses during reload. */
+ if (fast_exit_hack)
+ return;
+
/*
* This is a tricky part - we don't know whether route 'old' was
* exported to protocol 'p' or was filtered by the export filter.
@@ -245,9 +253,11 @@ do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old,
else
p->stats.exp_withdraws_accepted++;
+ /* Hack: We do not decrease exp_routes during refeed, we instead
+ reset exp_routes at the start of refeed. */
if (new)
p->stats.exp_routes++;
- if (old)
+ if (old && !refeed)
p->stats.exp_routes--;
if (p->debug & D_ROUTES)