diff options
author | dimitri staessens <[email protected]> | 2016-05-15 14:45:39 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-05-15 14:45:39 +0200 |
commit | 37a0ce98538c69b264898b7994fbac1d6e465a2f (patch) | |
tree | 85395fa2ac46f49db596f0748cac86a544df8ac6 /src/ipcpd/shim-udp | |
parent | a7cfeec50d962d6c56f9d3e4d60c2d1d49c23734 (diff) | |
parent | 561a9a53b08ce764e5134b6306dde0cb3ffaebc2 (diff) | |
download | ouroboros-37a0ce98538c69b264898b7994fbac1d6e465a2f.tar.gz ouroboros-37a0ce98538c69b264898b7994fbac1d6e465a2f.zip |
Merged in sandervrijders/ouroboros/be (pull request #88)
ipcpd: Move lock in ipcp_udp_listener
Diffstat (limited to 'src/ipcpd/shim-udp')
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 4 |
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; |