]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Report errors ACCEPT_ACL/DENY_ACL control interface commands
authorMasafumi Utsugi <mutsugi@allied-telesis.co.jp>
Tue, 29 Sep 2020 06:12:01 +0000 (15:12 +0900)
committerJouni Malinen <j@w1.fi>
Sun, 7 Feb 2021 08:20:58 +0000 (10:20 +0200)
Return FAIL for couple of the operations that were previously ignoring
invalid addresses without reporting errors.

Signed-off-by: Masafumi Utsugi <mutsugi@allied-telesis.co.jp>
hostapd/ctrl_iface.c

index 9fd55d6c56f2ecc168a1bd2aaed1c80b66173897..5859d160581fa79251b7c488bd66bfd79fe9f3ec 100644 (file)
@@ -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,