diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 477ea5bb2..66b843ca0 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -202,13 +202,6 @@ int hostapd_mac_comp(const void *a, const void *b) } -int hostapd_mac_comp_empty(const void *a) -{ - macaddr empty = { 0 }; - return os_memcmp(a, empty, sizeof(macaddr)); -} - - static int hostapd_config_read_wpa_psk(const char *fname, struct hostapd_ssid *ssid) { @@ -790,7 +783,7 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss, return -1; } - if (full_config && hostapd_mac_comp_empty(bss->bssid) != 0) { + if (full_config && !is_zero_ether_addr(bss->bssid)) { size_t i; for (i = 0; i < conf->num_bss; i++) { diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index fcd973287..f19cac6cf 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -694,7 +694,6 @@ struct hostapd_config { int hostapd_mac_comp(const void *a, const void *b); -int hostapd_mac_comp_empty(const void *a); struct hostapd_config * hostapd_config_defaults(void); void hostapd_config_defaults_bss(struct hostapd_bss_config *bss); void hostapd_config_free_eap_user(struct hostapd_eap_user *user); diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 4e7c0378f..303786b46 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -521,7 +521,7 @@ static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface) /* Determine the bits necessary to any configured BSSIDs, if they are higher than the number of BSSIDs. */ for (j = 0; j < iface->conf->num_bss; j++) { - if (hostapd_mac_comp_empty(iface->conf->bss[j]->bssid) == 0) { + if (is_zero_ether_addr(iface->conf->bss[j]->bssid)) { if (j) auto_addr++; continue; @@ -905,7 +905,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) hapd->started = 1; if (!first || first == -1) { - if (hostapd_mac_comp_empty(conf->bssid) == 0) { + if (is_zero_ether_addr(conf->bssid)) { /* Allocate the next available BSSID. */ do { inc_byte_array(hapd->own_addr, ETH_ALEN); @@ -1631,7 +1631,7 @@ static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, } while (j-- > 0); goto fail; } - if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0) + if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } hapd = iface->bss[0];