summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-05-21 16:17:10 +0200
committerSander Vrijders <sander@ouroboros.rocks>2022-05-22 15:11:22 +0200
commit072f555c07318a946cd2131b9b261d11a96fbbf8 (patch)
treed9d804697aea5574ff626ce78de3888062a05502
parentbec8f9ac7d6ebefbce6bd4c882c0f9616f561f1c (diff)
downloadouroboros-072f555c07318a946cd2131b9b261d11a96fbbf8.tar.gz
ouroboros-072f555c07318a946cd2131b9b261d11a96fbbf8.zip
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 <dimitri@ouroboros.rocks> Tested-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/ipcpd/eth/eth.c4
-rw-r--r--src/ipcpd/local/main.c4
-rw-r--r--src/ipcpd/udp/main.c4
3 files changed, 6 insertions, 6 deletions
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);