aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/files/netifd.sh
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2017-01-23 14:52:27 +0100
committerJo-Philipp Wich <jo@mein.io>2017-01-23 14:55:46 +0100
commit633c35aaa46d96721ea11462a510ae7c41d18378 (patch)
tree3c50882dbe05f9b7876ce78c4ca2dae61eb27c27 /package/network/services/hostapd/files/netifd.sh
parent6699f58fdbfd74cd3206bd1bc3311e395204ba30 (diff)
downloadupstream-633c35aaa46d96721ea11462a510ae7c41d18378.tar.gz
upstream-633c35aaa46d96721ea11462a510ae7c41d18378.tar.bz2
upstream-633c35aaa46d96721ea11462a510ae7c41d18378.zip
hostapd: fix stray "out of range" shell errors in hostapd.sh
The hostapd_append_wpa_key_mgmt() procedure uses the possibly uninitialized $ieee80211r and $ieee80211w variables in a numerical comparisation, leading to stray "netifd: radio0 (0000): sh: out of range" errors in logread when WPA-PSK security is enabled. Ensure that those variables are substituted with a default value in order to avoid emitting this (harmless) shell error. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network/services/hostapd/files/netifd.sh')
-rw-r--r--package/network/services/hostapd/files/netifd.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index fb23e52e67..937825de11 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -40,8 +40,8 @@ hostapd_append_wpa_key_mgmt() {
local auth_type="$(echo $auth_type | tr 'a-z' 'A-Z')"
append wpa_key_mgmt "WPA-$auth_type"
- [ "$ieee80211r" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type}"
- [ "$ieee80211w" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type}-SHA256"
+ [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type}"
+ [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type}-SHA256"
}
hostapd_add_log_config() {