]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Table export: ignoring invalid routes before marking them in export maps
authorMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 19:20:32 +0000 (20:20 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 20:09:19 +0000 (21:09 +0100)
Fast subsequent updates on filtered routes made the code crash because
no flags were set while ignoring them. And if these routes flapped, the
squashed export update crashed on a consistency check.

We ignore them unconditionally so we don't have to mark them at all and
we can convert them to NULL even before export maps are touched.

nest/rt-table.c

index 845b062edd306b3984c45ce84d1505cb014a8f5b..fb3cce650313a04df9104f8013f68268319f6db8 100644 (file)
@@ -1165,19 +1165,6 @@ rt_notify_basic(struct channel *c, const rte *new, const rte *old)
 {
   const rte *trte = new ?: old;
 
-  /* Ignore invalid routes */
-  if (!rte_is_valid(new))
-    new = NULL;
-
-  if (!rte_is_valid(old))
-    old = NULL;
-
-  if (!new && !old)
-  {
-    channel_rte_trace_out(D_ROUTES, c, trte, "idempotent withdraw (filtered on import)");
-    return;
-  }
-
   /* Have we exported the old route? */
   if (old)
   {
@@ -1580,6 +1567,14 @@ channel_notify_basic(void *_channel)
              rt_export_processed(&c->out_req, rpe->it.seq);
            }
 
+         /* Ignore invalid routes */
+         if (!rte_is_valid(new))
+           new = NULL;
+
+         if (!rte_is_valid(old))
+           old = NULL;
+
+         /* Update status map flags for id-only updates */
          if (new && old && rte_same(new, old))
          {
            channel_rte_trace_out(D_ROUTES, c, new, "already exported");
@@ -1601,7 +1596,7 @@ channel_notify_basic(void *_channel)
                bug("Withdrawn route never seen before");
          }
          else if (!new && !old)
-           channel_rte_trace_out(D_ROUTES, c, u->update->new, "idempotent withdraw (squash)");
+           channel_rte_trace_out(D_ROUTES, c, u->update->new, "idempotent withdraw");
          else
            rt_notify_basic(c, new, old);