]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed deferred route freeing crash
authorMaria Matejka <mq@ucw.cz>
Fri, 7 Jun 2024 06:59:48 +0000 (08:59 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 12 Jun 2024 07:23:50 +0000 (09:23 +0200)
The sending channel may be already gone when rte_free_deferred()
is finally called so we have to log about route freeing in the
synchronous call instead.

nest/rt-table.c

index b06b2cd1326b8b68eb40339025d170aa1f827c53..421a5e92285ffc181c3cbeda5871494af994fa52 100644 (file)
@@ -558,6 +558,7 @@ rte_free(struct rte_storage *e, struct rtable_private *tab)
   if (!tab->rte_free_deferred++)
     rt_lock_table(tab);
 
+  rt_rte_trace_in(D_ROUTES, e->rte.sender->req, &e->rte, "freeing");
   defer_call(&rfdi.dc, sizeof rfdi);
 }
 
@@ -571,8 +572,6 @@ rte_free_deferred(struct deferred_call *dc)
 
   /* No need for synchronize_rcu, implied by the deferred_call */
 
-  rt_rte_trace_in(D_ROUTES, e->rte.sender->req, &e->rte, "freeing");
-
   struct netindex *i = RTE_GET_NETINDEX(&e->rte);
   net_unlock_index(tab->netindex, i);