diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-07-15 15:59:49 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-07-15 15:59:49 +0200 |
commit | 3a66f9092d8fcb721bfa9f00626e6a85741bb0df (patch) | |
tree | 936e0f4857a48a4be17087c2d32b754b09433747 /src/irmd/main.c | |
parent | 71956f22abec7bb15f6bfc52b4168ff85499eea1 (diff) | |
parent | e14d0da88d4f3fcd0c19c231b59d31189c4d71ad (diff) | |
download | ouroboros-3a66f9092d8fcb721bfa9f00626e6a85741bb0df.tar.gz ouroboros-3a66f9092d8fcb721bfa9f00626e6a85741bb0df.zip |
Merged in dstaesse/ouroboros/be-irmd-fix (pull request #174)
irmd: Fix accessing reg_api struct after destroy
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; |