]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed bad filter re-evaluation with import table if filtered->accepted
authorMaria Matejka <mq@ucw.cz>
Wed, 8 Mar 2023 20:38:18 +0000 (21:38 +0100)
committerMaria Matejka <mq@ucw.cz>
Tue, 4 Apr 2023 15:00:58 +0000 (17:00 +0200)
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.

lib/route.h
nest/proto.c
nest/rt-table.c
proto/pipe/pipe.c

index 50e6244065aeb66be85a740d2149376452252469..c84691636d9c4a94beaef096b6de5b2cd31a35a4 100644 (file)
@@ -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 */
index e37bc93a8140eb5700c7b28dc2eb9b80e0c053e9..6c6d4ed3d94d6b068267cf8941d10104e0fa94ee 100644 (file)
@@ -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);
index 3428c122bb68a709acfa4ac42a84a61350fede55..218fcbe7895ba832c19a7ece983a7d64fd099a74 100644 (file)
@@ -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;
 
index 9d1bb6cee0f5b6483cb004f85e475d9b244fb3d1..b2083010dbebfd2ec74527ae49e8d9373930255a 100644 (file)
@@ -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);