From dfe5a46fb5315112d1173ac983ffc416dc3ecf18 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sun, 22 May 2016 14:53:22 +0200 Subject: 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. --- src/irmd/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/irmd/main.c') 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); -- cgit v1.2.3