aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-27 10:02:53 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-27 10:02:53 (GMT)
commita5861afcbd3c464a1d6c90fdb83ecbac1fbfe966 (patch)
tree4378853bbc3b8a470cc1676392e4345e76e0514a /hostapd
parentf78402acea7836540b916cf9053ae0e02d290301 (diff)
downloadhostap-a5861afcbd3c464a1d6c90fdb83ecbac1fbfe966.zip
hostap-a5861afcbd3c464a1d6c90fdb83ecbac1fbfe966.tar.gz
hostap-a5861afcbd3c464a1d6c90fdb83ecbac1fbfe966.tar.bz2
hostapd: Do not update invalid wep_key_len_unicast
Previously, the update command was rejected, but the configuration parameter value was updated anyway. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index dc062ff..a115c1e 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2304,14 +2304,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
}
bss->default_wep_key_len = val;
} else if (os_strcmp(buf, "wep_key_len_unicast") == 0) {
- bss->individual_wep_key_len = atoi(pos);
- if (bss->individual_wep_key_len < 0 ||
- bss->individual_wep_key_len > 13) {
- wpa_printf(MSG_ERROR, "Line %d: invalid WEP key len %d (= %d bits)",
- line, bss->individual_wep_key_len,
- bss->individual_wep_key_len * 8);
+ int val = atoi(pos);
+
+ if (val < 0 || val > 13) {
+ wpa_printf(MSG_ERROR,
+ "Line %d: invalid WEP key len %d (= %d bits)",
+ line, val, val * 8);
return 1;
}
+ bss->individual_wep_key_len = val;
} else if (os_strcmp(buf, "wep_rekey_period") == 0) {
bss->wep_rekeying_period = atoi(pos);
if (bss->wep_rekeying_period < 0) {