]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
rt-table: fixed rt_notify_basic - old route is now cleared in case it was previously...
authorKaterina Kubecova <katerina.kubecova@nic.cz>
Tue, 25 Feb 2025 11:46:06 +0000 (12:46 +0100)
committerKaterina Kubecova <katerina.kubecova@nic.cz>
Tue, 25 Feb 2025 13:19:41 +0000 (14:19 +0100)
nest/rt-table.c

index a2082e620d718a7368edc002f7c13f0e7c48e7b8..07600d9fb65e86026cff90795db3cca7206a487c 100644 (file)
@@ -1197,8 +1197,18 @@ rt_notify_basic(struct channel *c, const rte *new, const rte *old)
   }
 
   /* Have we exported the old route? */
-  if (old && !bmap_test(&c->export_accepted_map, old->id))
-    old = NULL;
+  if (old)
+    /* If the old route exists, it is either in rejected or in accepted map.
+     * If it is in rejcted map, we clear it right now, if it is in accepted map,
+     * we get rid of it in do_rt_notify. */
+    if (bmap_test(&c->export_rejected_map, old->id))
+    {
+      ASSERT_DIE(!bmap_test(&c->export_accepted_map, old->id));
+      bmap_clear(&c->export_rejected_map, old->id);
+      old = NULL;
+    }
+    else
+      ASSERT_DIE(bmap_test(&c->export_accepted_map, old->id));
 
   /* Withdraw to withdraw. */
   if (!np && !old)