]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Pipe: Fix inconsistency caused by rare pipe collision
authorMaria Matejka <mq@ucw.cz>
Fri, 13 Jun 2025 18:37:16 +0000 (20:37 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 14 Jun 2025 20:06:38 +0000 (22:06 +0200)
When two different pipes modify the same route in two different ways
and both results are attempted to be imported into the same table,
the table complains and should ignore the whole update. Yet it did so
only if the routes were identical (which was also tested previously).

Instead of ignoring, this routine replaced the original route with the
new one from another sender which caused a discrepancy in counters in
the original sender and later crash on failed consistency check.

Discovered randomly when trying to reproduce another bug and
accidentally doing exactly this sequence of pipe collision and
then reconfiguration to rectify the collision by removing the pipe
altogether.

Fixes: #282
nest/rt-table.c

index cc79be1935a7ed1865be910f2b7e24e2b1504c47..6383f2fe061c284e201cbdb22f7b2309d98739da 100644 (file)
@@ -1978,6 +1978,14 @@ rte_recalculate(struct rtable_private *table, struct rt_import_hook *c, struct n
 
          log_rl(&table->rl_pipe, L_ERR "Route source collision in table %s: %N %s/%u:%u",
                c->table->name, i->addr, old->src->owner->name, old->src->private_id, old->src->global_id);
+
+         /* Ignore the whole update */
+         if (new)
+         {
+           rt_rte_trace_in(D_ROUTES, req, new, "collided");
+           rte_free(new_stored, table);
+           return;
+         }
        }
 
          if (new && rte_same(old, &new_stored->rte))