From f98fe2fd00c53137017f44fd25cfd8812a54f840 Mon Sep 17 00:00:00 2001 From: Masafumi Utsugi Date: Tue, 29 Sep 2020 15:12:01 +0900 Subject: [PATCH] hostapd: Report errors ACCEPT_ACL/DENY_ACL control interface commands Return FAIL for couple of the operations that were previously ignoring invalid addresses without reporting errors. Signed-off-by: Masafumi Utsugi --- hostapd/ctrl_iface.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 9fd55d6c5..5859d1605 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -3690,6 +3690,8 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, &hapd->conf->accept_mac, &hapd->conf->num_accept_mac, buf + 19)) hostapd_disassoc_accept_mac(hapd); + else + reply_len = -1; } else if (os_strcmp(buf + 11, "SHOW") == 0) { reply_len = hostapd_ctrl_iface_acl_show_mac( hapd->conf->accept_mac, @@ -3706,10 +3708,13 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, &hapd->conf->deny_mac, &hapd->conf->num_deny_mac, buf + 17)) hostapd_disassoc_deny_mac(hapd); + else + reply_len = -1; } else if (os_strncmp(buf + 9, "DEL_MAC ", 8) == 0) { - hostapd_ctrl_iface_acl_del_mac( - &hapd->conf->deny_mac, - &hapd->conf->num_deny_mac, buf + 17); + if (hostapd_ctrl_iface_acl_del_mac( + &hapd->conf->deny_mac, + &hapd->conf->num_deny_mac, buf + 17)) + reply_len = -1; } else if (os_strcmp(buf + 9, "SHOW") == 0) { reply_len = hostapd_ctrl_iface_acl_show_mac( hapd->conf->deny_mac,