From bb1734267410ac0a5bac929ebc9932daf7f89229 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 4 Mar 2025 13:04:20 +0100 Subject: [PATCH] Table best export: asserting seqmap consistency In case of some exports have been seen and others not, it makes no sense for the second one to be seen if the first one was not seen. --- nest/rt-table.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nest/rt-table.c b/nest/rt-table.c index ca808ea42..648f18640 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2612,10 +2612,14 @@ rt_feed_net_best(struct rt_exporter *e, struct rcu_unwinder *u, u32 index, struc best = NULL; uint ecnt = 0, ocnt = 0; + bool export_in_map = true; for (const struct rt_pending_export *rpe = first; rpe; rpe = atomic_load_explicit(&rpe->next, memory_order_acquire)) - if (!seen || !bmap_test(seen, rpe->it.seq)) + if (seen && bmap_test(seen, rpe->it.seq)) + ASSERT_DIE(export_in_map); + else { + export_in_map = false; ecnt++; if (rpe->it.old && (!best || (rpe->it.old != &best->rte))) ocnt++; -- 2.47.2