summaryrefslogtreecommitdiff
path: root/lib/route.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-03-08 21:38:18 +0100
committerMaria Matejka <mq@ucw.cz>2023-04-04 17:00:58 +0200
commit97d2875e999487bfe91f16c77c409ac0080541d3 (patch)
treeda69c481133162c2c7621095ba04ca49aa77b880 /lib/route.h
parentaa5fc3b99d9bada123cb4b7030fa0c8ba5fae2ea (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.
Diffstat (limited to 'lib/route.h')
-rw-r--r--lib/route.h10
1 files changed, 10 insertions, 0 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 */