summaryrefslogtreecommitdiff
path: root/src/irmd
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-22 14:53:22 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-05-22 15:04:20 +0200
commitdfe5a46fb5315112d1173ac983ffc416dc3ecf18 (patch)
treefe6459aadc00e81ef1252392dc07e009e3e8888e /src/irmd
parent745cc666e34d7e0c29822615987ce02832ac5a8c (diff)
downloadouroboros-dfe5a46fb5315112d1173ac983ffc416dc3ecf18.tar.gz
ouroboros-dfe5a46fb5315112d1173ac983ffc416dc3ecf18.zip
lib, ipcpd, irmd: fixes deallocation and fast path
The fast path has been rewritten to have certainty to read the correct flow. Deallocation will not release port_id's or fd's until they are explicitly released locally.
Diffstat (limited to 'src/irmd')
-rw-r--r--src/irmd/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index f1993960..4ee6399d 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1076,6 +1076,8 @@ static int flow_dealloc(int port_id)
rw_lock_rdlock(&instance->state_lock);
rw_lock_wrlock(&instance->flows_lock);
+ bmp_release(instance->port_ids, port_id);
+
e = get_port_map_entry(port_id);
if (e == NULL) {
rw_lock_unlock(&instance->flows_lock);
@@ -1087,8 +1089,6 @@ static int flow_dealloc(int port_id)
list_del(&e->next);
- bmp_release(instance->port_ids, port_id);
-
ret = ipcp_flow_dealloc(n_1_pid, port_id);
rw_lock_unlock(&instance->flows_lock);
@@ -1217,8 +1217,6 @@ static int flow_dealloc_ipcp(int port_id)
return 0;
}
- bmp_release(instance->port_ids, port_id);
-
list_del(&e->next);
rw_lock_unlock(&instance->flows_lock);