]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Configure driver ACL even if MAC address list is empty
authorAmarnath Hullur Subramanyam <amarnath@qca.qualcomm.com>
Mon, 16 Jun 2014 13:22:36 +0000 (16:22 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 16 Jun 2014 13:22:36 +0000 (16:22 +0300)
Earlier commit related to MAC address based access control list
offloaded to the driver was not sending ACL configuration to the driver
if the MAC address list was empty. Remove this check as empty access
control list is a valid use case and sending ACL parameters should not
be dependent on whether the list is empty.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/hostapd.c

index ed7330193e792cb20312774a67fd4def997d7ade..4e09fa3a6b8820aaac0bb48bb7e190a91e7c0d1a 100644 (file)
@@ -946,35 +946,24 @@ static void hostapd_set_acl(struct hostapd_data *hapd)
 
        if (hapd->iface->drv_max_acl_mac_addrs == 0)
                return;
-       if (!(conf->bss[0]->num_accept_mac || conf->bss[0]->num_deny_mac))
-               return;
 
        if (conf->bss[0]->macaddr_acl == DENY_UNLESS_ACCEPTED) {
-               if (conf->bss[0]->num_accept_mac) {
-                       accept_acl = 1;
-                       err = hostapd_set_acl_list(hapd,
-                                                  conf->bss[0]->accept_mac,
-                                                  conf->bss[0]->num_accept_mac,
-                                                  accept_acl);
-                       if (err) {
-                               wpa_printf(MSG_DEBUG, "Failed to set accept acl");
-                               return;
-                       }
-               } else {
-                       wpa_printf(MSG_DEBUG, "Mismatch between ACL Policy & Accept/deny lists file");
+               accept_acl = 1;
+               err = hostapd_set_acl_list(hapd, conf->bss[0]->accept_mac,
+                                          conf->bss[0]->num_accept_mac,
+                                          accept_acl);
+               if (err) {
+                       wpa_printf(MSG_DEBUG, "Failed to set accept acl");
+                       return;
                }
        } else if (conf->bss[0]->macaddr_acl == ACCEPT_UNLESS_DENIED) {
-               if (conf->bss[0]->num_deny_mac) {
-                       accept_acl = 0;
-                       err = hostapd_set_acl_list(hapd, conf->bss[0]->deny_mac,
-                                                  conf->bss[0]->num_deny_mac,
-                                                  accept_acl);
-                       if (err) {
-                               wpa_printf(MSG_DEBUG, "Failed to set deny acl");
-                               return;
-                       }
-               } else {
-                       wpa_printf(MSG_DEBUG, "Mismatch between ACL Policy & Accept/deny lists file");
+               accept_acl = 0;
+               err = hostapd_set_acl_list(hapd, conf->bss[0]->deny_mac,
+                                          conf->bss[0]->num_deny_mac,
+                                          accept_acl);
+               if (err) {
+                       wpa_printf(MSG_DEBUG, "Failed to set deny acl");
+                       return;
                }
        }
 }