From c0a08d0f7a4b66a030eb0eca0e3f1dc45ff08665 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 5 Oct 2016 11:42:59 +0200 Subject: lib, ipcpd: Fix bad locking Some locks were taken at an inappropriate time, causing the shim-eth-llc to block indefinitely upon shutdown and causing flow allocation to halt since a response could never be given. --- src/ipcpd/shim-eth-llc/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/ipcpd/shim-eth-llc/main.c') diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 2cf46e51..7a64b9e1 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -575,14 +575,11 @@ static void * eth_llc_ipcp_sdu_writer(void * o) uint8_t dsap; uint8_t r_addr[MAC_SIZE]; - pthread_rwlock_rdlock(&ipcpi.state_lock); - fd = ipcp_flow_read(&sdb); - if (fd < 0) { - pthread_rwlock_unlock(&ipcpi.state_lock); + if (fd < 0) continue; - } + pthread_rwlock_rdlock(&ipcpi.state_lock); pthread_rwlock_rdlock(ð_llc_data.flows_lock); ssap = reverse_bits(eth_llc_data.fd_to_ef[fd].sap); -- cgit v1.2.3