diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-07-06 02:04:45 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-07-06 02:04:45 +0200 |
commit | 092c4930277c0f0f0dcb0c4013ff642314f90842 (patch) | |
tree | 052b2f2f73d2a4443038a1229e56d60fbfc2dd9f /nest | |
parent | 7b9b0c0a0087def6a3fc11824a891be5940a257b (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.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index 9ce52428..9dcbda05 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -678,8 +678,18 @@ rt_notify_accepted(struct channel *c, net *net, rte *new_changed, rte *old_chang * * - 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 <= c->last_tx_filter_change)) + { + old_best = old_changed; + goto found; + } + /* First case */ if (old_meet) if (old_best = export_filter(c, old_changed, &old_free, 1)) |