aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-27 09:43:13 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-27 09:43:13 (GMT)
commit9266d00bf991aa833285ad074d3ce6dc228d8321 (patch)
treeccd297cbd0e9add34a4a6cadc5a1297498e989a6
parent8628555f9b50d409fca44593c00470888c4eb286 (diff)
downloadhostap-9266d00bf991aa833285ad074d3ce6dc228d8321.zip
hostap-9266d00bf991aa833285ad074d3ce6dc228d8321.tar.gz
hostap-9266d00bf991aa833285ad074d3ce6dc228d8321.tar.bz2
hostapd: Reject invalid macaddr_acl value
Previously, this was noted in error log, but the invalid value was stored in the configuration without rejecting it. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--hostapd/config_file.c13
-rw-r--r--src/ap/ap_config.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index ada6601..6077dc9 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2113,13 +2113,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "utf8_ssid") == 0) {
bss->ssid.utf8_ssid = atoi(pos) > 0;
} else if (os_strcmp(buf, "macaddr_acl") == 0) {
- bss->macaddr_acl = atoi(pos);
- if (bss->macaddr_acl != ACCEPT_UNLESS_DENIED &&
- bss->macaddr_acl != DENY_UNLESS_ACCEPTED &&
- bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) {
+ enum macaddr_acl acl = atoi(pos);
+
+ if (acl != ACCEPT_UNLESS_DENIED &&
+ acl != DENY_UNLESS_ACCEPTED &&
+ acl != USE_EXTERNAL_RADIUS_AUTH) {
wpa_printf(MSG_ERROR, "Line %d: unknown macaddr_acl %d",
- line, bss->macaddr_acl);
+ line, acl);
+ return 1;
}
+ bss->macaddr_acl = acl;
} else if (os_strcmp(buf, "accept_mac_file") == 0) {
if (hostapd_config_read_maclist(pos, &bss->accept_mac,
&bss->num_accept_mac)) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index c9cc22a..69801d3 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -293,7 +293,7 @@ struct hostapd_bss_config {
char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
* frames */
- enum {
+ enum macaddr_acl {
ACCEPT_UNLESS_DENIED = 0,
DENY_UNLESS_ACCEPTED = 1,
USE_EXTERNAL_RADIUS_AUTH = 2