[source] hostapd: fix stray "out of range" shell errors in hostapd.sh
LEDE Commits
lede-commits at lists.infradead.org
Mon Jan 23 05:56:24 PST 2017
jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/b850218584c0a7bc573579b0d21d243e7ae1bf03
commit b850218584c0a7bc573579b0d21d243e7ae1bf03
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Jan 23 14:52:27 2017 +0100
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 at mein.io>
---
package/network/services/hostapd/Makefile | 2 +-
package/network/services/hostapd/files/netifd.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 96b652f..50c162e 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=http://w1.fi/hostap.git
PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index fb23e52..937825d 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() {
More information about the lede-commits
mailing list