From 072f555c07318a946cd2131b9b261d11a96fbbf8 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 21 May 2022 16:17:10 +0200 Subject: ipcpd: Fix deadlock on exit in udp, local, eth The IPCP flow_set was getting destroyed with the IPCP main loop still running, causing potential deadlocks. Reported-by: Thijs Paelman Confirmed-by: Dimitri Staessens Tested-by: Dimitri Staessens Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/eth/eth.c | 4 ++-- src/ipcpd/local/main.c | 4 ++-- src/ipcpd/udp/main.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ipcpd') diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index ade8485c..294373b6 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -1883,10 +1883,10 @@ int main(int argc, #endif } - eth_data_fini(); - ipcp_fini(); + eth_data_fini(); + exit(EXIT_SUCCESS); fail_create_r: diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index 2b20ae15..15b6128b 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -377,10 +377,10 @@ int main(int argc, pthread_join(local_data.packet_loop, NULL); } - local_data_fini(); - ipcp_fini(); + local_data_fini(); + exit(EXIT_SUCCESS); fail_create_r: ipcp_set_state(IPCP_NULL); diff --git a/src/ipcpd/udp/main.c b/src/ipcpd/udp/main.c index 601efa5c..9960f880 100644 --- a/src/ipcpd/udp/main.c +++ b/src/ipcpd/udp/main.c @@ -1163,10 +1163,10 @@ int main(int argc, pthread_join(udp_data.mgmt_handler, NULL); } - udp_data_fini(); - ipcp_fini(); + udp_data_fini(); + exit(EXIT_SUCCESS); fail_create_r: ipcp_set_state(IPCP_NULL); -- cgit v1.2.3