diff options
author | dimitri staessens <[email protected]> | 2016-07-15 15:49:23 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-07-15 15:49:23 +0200 |
commit | e14d0da88d4f3fcd0c19c231b59d31189c4d71ad (patch) | |
tree | 936e0f4857a48a4be17087c2d32b754b09433747 /src/irmd/main.c | |
parent | 71956f22abec7bb15f6bfc52b4168ff85499eea1 (diff) | |
download | ouroboros-e14d0da88d4f3fcd0c19c231b59d31189c4d71ad.tar.gz ouroboros-e14d0da88d4f3fcd0c19c231b59d31189c4d71ad.zip |
irmd: Fix accessing reg_api struct after destroy
The destroy now only frees after all threads stopped using the object.
Also fixes a SEGV when trying to allocate a flow to a remote name.
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r-- | src/irmd/main.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 1da4b310..625c28c8 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -247,6 +247,36 @@ static pid_t get_ipcp_by_dst_name(char * dst_name) struct list_head * pos = NULL; char * dif_name = registry_get_dif_for_dst(&instance->registry, dst_name); + if (dif_name == NULL) { + list_for_each(pos, &instance->ipcps) { + struct ipcp_entry * e = + list_entry(pos, struct ipcp_entry, next); + if (e->type == IPCP_NORMAL) { + dif_name = e->dif_name; + break; + } + } + + list_for_each(pos, &instance->ipcps) { + struct ipcp_entry * e = + list_entry(pos, struct ipcp_entry, next); + if (e->type == IPCP_SHIM_ETH_LLC) { + dif_name = e->dif_name; + break; + } + } + + + list_for_each(pos, &instance->ipcps) { + struct ipcp_entry * e = + list_entry(pos, struct ipcp_entry, next); + if (e->type == IPCP_SHIM_UDP) { + dif_name = e->dif_name; + break; + } + } + } + if (dif_name == NULL) return -1; |