From aa394e37a56eaed0a575b8a1a34ebc31ca06af42 Mon Sep 17 00:00:00 2001 From: Nishant Pandey Date: Tue, 22 Sep 2020 14:07:05 +0530 Subject: [PATCH] hostapd: Fix calling hostapd_disassoc_accept_mac in CLI command Calling hostapd_disassoc_accept_mac is not needed when we add mac address to accept list and it is required to be called when any of the mac address is deleted from accept mac list Signed-off-by: Nishant Pandey --- hostapd/ctrl_iface.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 584aee2..66c63a0 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -3709,16 +3709,16 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, eloop_terminate(); } else if (os_strncmp(buf, "ACCEPT_ACL ", 11) == 0) { if (os_strncmp(buf + 11, "ADD_MAC ", 8) == 0) { - if (!hostapd_ctrl_iface_acl_add_mac( - &hapd->conf->accept_mac, - &hapd->conf->num_accept_mac, buf + 19)) + hostapd_ctrl_iface_acl_add_mac( + &hapd->conf->accept_mac, + &hapd->conf->num_accept_mac, buf + 19); + } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { + if (!hostapd_ctrl_iface_acl_del_mac( + &hapd->conf->accept_mac, + &hapd->conf->num_accept_mac, buf + 19)) hostapd_disassoc_accept_mac(hapd); else reply_len = -1; - } else if (os_strncmp((buf + 11), "DEL_MAC ", 8) == 0) { - hostapd_ctrl_iface_acl_del_mac( - &hapd->conf->accept_mac, - &hapd->conf->num_accept_mac, buf + 19); } else if (os_strcmp(buf + 11, "SHOW") == 0) { reply_len = hostapd_ctrl_iface_acl_show_mac( hapd->conf->accept_mac, -- 2.7.4