From 115d2d5552fc4acd0f17bea7c0ec6c8a7042ae4a Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 31 Aug 2016 16:11:45 +0200 Subject: irmd: Fix binding after registering Flow will now allocate correctly when the name is registered in a DIF before it is bound to an AP. --- src/irmd/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/irmd/main.c b/src/irmd/main.c index 29f6d9d0..465415b8 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -482,6 +482,7 @@ static int bind_ap(char * ap, int i; char * name_dup = NULL; struct apn_entry * e = NULL; + struct reg_entry * re = NULL; if (ap == NULL || name == NULL) return -EINVAL; @@ -561,6 +562,10 @@ static int bind_ap(char * ap, return -ENOMEM; } + re = registry_get_entry(&irmd->registry, name); + if (re != NULL && reg_entry_add_apn(re, e) < 0) + LOG_ERR("Failed adding AP %s for name %s.", ap, name); + pthread_rwlock_unlock(&irmd->reg_lock); pthread_rwlock_unlock(&irmd->state_lock); -- cgit v1.2.3