diff options
author | Maria Matejka <mq@ucw.cz> | 2023-03-08 21:38:18 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-04 17:00:58 +0200 |
commit | 97d2875e999487bfe91f16c77c409ac0080541d3 (patch) | |
tree | da69c481133162c2c7621095ba04ca49aa77b880 | |
parent | aa5fc3b99d9bada123cb4b7030fa0c8ba5fae2ea (diff) |
Fixed bad filter re-evaluation with import table if filtered->accepted
The import table feed wasn't resetting the table-specific route values
like REF_FILTERED and thus made the route look like filtered even though
it should have been re-evaluated as accepted.
-rw-r--r-- | lib/route.h | 10 | ||||
-rw-r--r-- | nest/proto.c | 3 | ||||
-rw-r--r-- | nest/rt-table.c | 4 | ||||
-rw-r--r-- | proto/pipe/pipe.c | 7 |
4 files changed, 18 insertions, 6 deletions
diff --git a/lib/route.h b/lib/route.h index 50e62440..c8469163 100644 --- a/lib/route.h +++ b/lib/route.h @@ -46,6 +46,16 @@ static inline int rte_is_valid(rte *r) { return r && !(r->flags & REF_FILTERED); /* Route just has REF_FILTERED flag */ static inline int rte_is_filtered(rte *r) { return !!(r->flags & REF_FILTERED); } +/* Strip the route of the table-specific values */ +static inline rte rte_init_from(const rte *r) +{ + return (rte) { + .attrs = r->attrs, + .net = r->net, + .src = r->src, + }; +} + struct rte_src { struct rte_src *next; /* Hash chain */ struct rte_owner *owner; /* Route source owner */ diff --git a/nest/proto.c b/nest/proto.c index e37bc93a..6c6d4ed3 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -657,7 +657,10 @@ channel_reload_stopped(struct rt_export_request *req) /* Restart reload */ if (c->reload_pending) + { + c->reload_pending = 0; channel_request_reload(c); + } if (c->channel_state != CS_UP) channel_check_stopped(c); diff --git a/nest/rt-table.c b/nest/rt-table.c index 3428c122..218fcbe7 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -4406,8 +4406,10 @@ void channel_reload_export_bulk(struct rt_export_request *req, const net_addr *n for (uint i=0; i<count; i++) if (feed[i]->sender == c->in_req.hook) { + /* Strip the table-specific information */ + rte new = rte_init_from(feed[i]); + /* Strip the later attribute layers */ - rte new = *feed[i]; while (new.attrs->next) new.attrs = new.attrs->next; diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index 9d1bb6ce..b2083010 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -62,12 +62,9 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte * if (new) { - rte e0 = { - .attrs = new->attrs, - .src = new->src, - .generation = new->generation + 1, - }; + rte e0 = rte_init_from(new); + e0.generation = new->generation + 1; ea_unset_attr(&e0.attrs, 0, &ea_gen_hostentry); rte_update(dst, n, &e0, new->src); |