diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-10-05 11:42:59 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-10-05 11:42:59 +0200 |
commit | c0a08d0f7a4b66a030eb0eca0e3f1dc45ff08665 (patch) | |
tree | d90985e61884066204bf45091ff59a106d147fad /src/lib | |
parent | 8a0bc74c2c7c3f5851b1a4dd51eb6ebbb0859a81 (diff) | |
download | ouroboros-c0a08d0f7a4b66a030eb0eca0e3f1dc45ff08665.tar.gz ouroboros-c0a08d0f7a4b66a030eb0eca0e3f1dc45ff08665.zip |
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.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c index 178ee287..8e1ee342 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -889,11 +889,11 @@ int np1_flow_resp(pid_t n_api, int port_id) int fd; struct shm_ap_rbuff * rb; + port_wait_assign(&ai.ports[port_id]); + pthread_rwlock_rdlock(&ai.data_lock); pthread_rwlock_wrlock(&ai.flows_lock); - port_wait_assign(&ai.ports[port_id]); - fd = ai.ports[port_id].fd; if (fd < 0) { pthread_rwlock_unlock(&ai.flows_lock); |