summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-07-03 19:21:42 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-07-03 19:21:59 +0200
commitcbfdf6ed057b993d7e107b4c39b8a5b81c081eee (patch)
tree0c6255bb81f037ceff0dfa9409a5829069ea24e1 /nest/rt-table.c
parent822a7ee6d5cd9bf38548026e0dd52fbc4634030d (diff)
Nest: Fix race condition during reconfiguration
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 patch fixes that by adding tx reconfiguration timestamp.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 28fe5baa..07bb0b12 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -426,13 +426,15 @@ rt_notify_basic(struct announce_hook *ah, net *net, rte *new0, rte *old0, int re
* reconfiguration and the end of refeed - if a newly filtered
* route disappears during this period, proper withdraw is not
* sent (because old would be also filtered) and the route is
- * not refeeded (because it disappeared before that).
+ * not refeeded (because it disappeared before that). Therefore,
+ * we also do not try to run the filter on old routes that are
+ * older than the last filter change.
*/
if (new)
new = export_filter(ah, new, &new_free, &tmpa, 0);
- if (old && !refeed)
+ if (old && !(refeed || (old->lastmod <= ah->last_out_filter_change)))
old = export_filter(ah, old, &old_free, NULL, 1);
if (!new && !old)