From: Maria Matejka Date: Fri, 13 Jun 2025 18:37:16 +0000 (+0200) Subject: Pipe: Fix inconsistency caused by rare pipe collision X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1acec6a5ed5ef4905d25d7f8d994451c006246a9;p=thirdparty%2Fbird.git Pipe: Fix inconsistency caused by rare pipe collision 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 --- diff --git a/nest/rt-table.c b/nest/rt-table.c index cc79be193..6383f2fe0 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -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))