summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-15 14:45:39 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-15 14:45:39 +0200
commit37a0ce98538c69b264898b7994fbac1d6e465a2f (patch)
tree85395fa2ac46f49db596f0748cac86a544df8ac6
parenta7cfeec50d962d6c56f9d3e4d60c2d1d49c23734 (diff)
parent561a9a53b08ce764e5134b6306dde0cb3ffaebc2 (diff)
downloadouroboros-37a0ce98538c69b264898b7994fbac1d6e465a2f.tar.gz
ouroboros-37a0ce98538c69b264898b7994fbac1d6e465a2f.zip
Merged in sandervrijders/ouroboros/be (pull request #88)
ipcpd: Move lock in ipcp_udp_listener
-rw-r--r--src/ipcpd/shim-udp/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c
index 9c295e30..74fa0d2b 100644
--- a/src/ipcpd/shim-udp/main.c
+++ b/src/ipcpd/shim-udp/main.c
@@ -395,6 +395,7 @@ static void * ipcp_udp_listener()
}
/* reply to IRM */
+ rw_lock_wrlock(&_ap_instance->flows_lock);
port_id = ipcp_flow_req_arr(getpid(),
buf,
@@ -404,11 +405,10 @@ static void * ipcp_udp_listener()
if (port_id < 0) {
LOG_ERR("Could not get port id from IRMd");
close(fd);
+ rw_lock_unlock(&_ap_instance->flows_lock);
continue;
}
- rw_lock_wrlock(&_ap_instance->flows_lock);
-
_ap_instance->flows[fd].port_id = port_id;
_ap_instance->flows[fd].rb = NULL;
_ap_instance->flows[fd].state = FLOW_PENDING;