diff --git a/src/core/cntlr_map.c b/src/core/cntlr_map.c index 67491ee3047bd846e02bf64d4e66b4501cfb0c72..e322e3db46b68a9028fb36e69a00adddb667065b 100644 --- a/src/core/cntlr_map.c +++ b/src/core/cntlr_map.c @@ -210,11 +210,6 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu) return -1; } - if (!memcmp(aladdr_origin, c->almac, 6)) { - trace("%s: Discard ap-autoconfig search from self\n", __func__); - return -1; - } - if (tv[1][0]->data[0] != IEEE80211_ROLE_REGISTRAR) { trace("%s: Discard ap-autoconfig search for role != registrar\n", __func__); @@ -247,12 +242,20 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu) return -1; for (i = 1; i <= tv[3][0]->data[0]; i++) { - if (tv[3][0]->data[i] != SUPPORTED_SERVICE_MULTIAP_AGENT) - continue; - - ret = cntlr_config_add_agent(&c->cfg, mac_str); - if (!ret) - cntlr_config_reload(&c->cfg); + if (tv[3][0]->data[i] == + SUPPORTED_SERVICE_MULTIAP_AGENT) { + ret = cntlr_config_add_agent(&c->cfg, mac_str); + if (!ret) + cntlr_config_reload(&c->cfg); + } else if (tv[3][0]->data[i] == + SUPPORTED_SERVICE_MULTIAP_CONTROLLER) { + if (!memcmp(aladdr_origin, c->almac, 6)) { + trace("%s: Discard ap-autoconfig "\ + "search from self\n", + __func__); + return -1; + } + } break; } }