From 2fd016776bca60e0a2bff69a9f130e4c3415bb4c Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 10 Aug 2025 10:25:34 +0200 Subject: ipcpd: Fix shutdown of link-state routing The link_state component tried to unregister from the notifier while it had threads running. The deadlock happens when notifier_event had a rdlock trying to delete a neighbour, while notifier_unreg tries to take the write lock. And the delete can't complete in the notifier. https://tree.taiga.io/project/dstaesse-ouroboros/us/113 We need to make sure that all threads are stopped before unregistering from the notifier. Updated link_state to use the start/stop() paradigm and not create/cancel threads within init/fini(). Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/routing/link-state.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ipcpd/unicast/routing/link-state.h') diff --git a/src/ipcpd/unicast/routing/link-state.h b/src/ipcpd/unicast/routing/link-state.h index d77d72df..7f78536b 100644 --- a/src/ipcpd/unicast/routing/link-state.h +++ b/src/ipcpd/unicast/routing/link-state.h @@ -32,6 +32,10 @@ int link_state_init(enum pol_routing pr); void link_state_fini(void); +int link_state_start(void); + +void link_state_stop(void); + struct routing_i * link_state_routing_i_create(struct pff * pff); void link_state_routing_i_destroy(struct routing_i * instance); -- cgit v1.2.3