summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-07-06 02:17:59 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-07-06 02:17:59 +0200
commit470efcb98cb33de2d5636679eb0f72c88280d6b8 (patch)
tree30221f98354f26c30f1e0a7ebcda04be44b2cc9d /nest
parentcbfdf6ed057b993d7e107b4c39b8a5b81c081eee (diff)
Nest: Fix race condition during reconfiguration, part 2
If export filter is changed during reconfiguration and a route disappears between reconfiguration and refeed (e.g., if the route is a static route also removed during the reconfiguration), the route is not withdrawn. The issue was fixed for regular channels by an earlier patch. This patch fixes the issue for channels in RA_ACCEPTED mode (first-pass-the-filter), used by BGP with 'secondary' option.
Diffstat (limited to 'nest')
-rw-r--r--nest/rt-table.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 07bb0b12..83f0e713 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -543,8 +543,18 @@ rt_notify_accepted(struct announce_hook *ah, net *net, rte *new_changed, rte *ol
*
* - We found new_best the same as new_changed, therefore it cannot
* be old_best and we have to continue search for old_best.
+ *
+ * There is also a hack to ensure consistency in case of changed filters.
+ * It does not find the proper old_best, just selects a non-NULL route.
*/
+ /* Hack for changed filters */
+ if (old_changed && (old_changed->lastmod <= ah->last_out_filter_change))
+ {
+ old_best = old_changed;
+ goto found;
+ }
+
/* First case */
if (old_meet)
if (old_best = export_filter(ah, old_changed, &old_free, NULL, 1))