diff options
author | Jouni Malinen <j@w1.fi> | 2016-12-27 10:24:02 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2016-12-27 10:24:02 (GMT) |
commit | 546680f81a903b7bd96eecb3ee60a363fe9d1c33 (patch) | |
tree | 2467691cffbd55606468bf2b17b5abfb44ac8c79 /hostapd | |
parent | 35677305896cd3561deaf84ac513258104b67e93 (diff) | |
download | hostap-546680f81a903b7bd96eecb3ee60a363fe9d1c33.zip hostap-546680f81a903b7bd96eecb3ee60a363fe9d1c33.tar.gz hostap-546680f81a903b7bd96eecb3ee60a363fe9d1c33.tar.bz2 |
hostapd: Do not update dtim_period with invalid value
Previously, the update command was rejected, but the actual value was
updated.
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd')
-rw-r--r-- | hostapd/config_file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c index a115c1e..8ebdd7b 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2750,12 +2750,14 @@ static int hostapd_config_fill(struct hostapd_config *conf, } #endif /* CONFIG_ACS */ } else if (os_strcmp(buf, "dtim_period") == 0) { - bss->dtim_period = atoi(pos); - if (bss->dtim_period < 1 || bss->dtim_period > 255) { + int val = atoi(pos); + + if (val < 1 || val > 255) { wpa_printf(MSG_ERROR, "Line %d: invalid dtim_period %d", - line, bss->dtim_period); + line, val); return 1; } + bss->dtim_period = val; } else if (os_strcmp(buf, "bss_load_update_period") == 0) { bss->bss_load_update_period = atoi(pos); if (bss->bss_load_update_period < 0 || |