summaryrefslogtreecommitdiff
path: root/src/ipcpd/local
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-29 10:15:22 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-29 10:15:54 +0200
commit462a3fb9b915dedf8b061b68a4db93f6e22ab29d (patch)
tree27d596fc4403363cfda9af734fc54edfad5258bd /src/ipcpd/local
parentee1974debcfba8d8b10ea9a60437d04502b965dc (diff)
downloadouroboros-462a3fb9b915dedf8b061b68a4db93f6e22ab29d.tar.gz
ouroboros-462a3fb9b915dedf8b061b68a4db93f6e22ab29d.zip
ipcpd: fixes shutdown lockup in local and shim-udp
Diffstat (limited to 'src/ipcpd/local')
-rw-r--r--src/ipcpd/local/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c
index b07b0a52..4a0ad683 100644
--- a/src/ipcpd/local/main.c
+++ b/src/ipcpd/local/main.c
@@ -201,6 +201,11 @@ static void * ipcp_local_sdu_loop(void * o)
struct rb_entry * e;
int fd;
+ e = shm_ap_rbuff_read(_ap_instance->rb);
+ if (e == NULL) {
+ continue;
+ }
+
rw_lock_rdlock(&_ipcp->state_lock);
if (_ipcp->state != IPCP_ENROLLED) {
@@ -208,12 +213,6 @@ static void * ipcp_local_sdu_loop(void * o)
return (void *) 1; /* -ENOTENROLLED */
}
- e = shm_ap_rbuff_read(_ap_instance->rb);
- if (e == NULL) {
- rw_lock_unlock(&_ipcp->state_lock);
- continue;
- }
-
rw_lock_rdlock(&_ap_instance->flows_lock);
fd = _ap_instance->in_out[port_id_to_fd(e->port_id)];
if (fd == -1) {