[openwrt/openwrt] hostapd: fix setting wps_state to "not configured"

LEDE Commits lede-commits at lists.infradead.org
Fri Jan 15 13:46:21 EST 2021


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d5bbd4975cbb6fbbfb57d183d1e03453d88f923d

commit d5bbd4975cbb6fbbfb57d183d1e03453d88f923d
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Tue Jan 12 10:30:08 2021 +0100

    hostapd: fix setting wps_state to "not configured"
    
    With encryption disabled, it was intended to set wpa_state=1 (enabled,
    not configured) through the 'wps_not_configured' flag.
    The flag is set appropriately but the condition using it is broken.
    Instead, 'wps_configured' is checked and wpa_state is always 2 (enabled,
    configured). Fix it by using the correct variable name.
    
    Fixes: 498d84fc4e00 ("netifd: add wireless configuration support
    and port mac80211 to the new framework")
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
    [commit title/message improvements]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/network/services/hostapd/Makefile         | 2 +-
 package/network/services/hostapd/files/hostapd.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 4f740951c0..cbbe6c1009 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:=27
+PKG_RELEASE:=28
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 815f22db74..45a49b8faa 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -666,7 +666,7 @@ hostapd_set_bss_options() {
 		set_default wps_independent 1
 
 		wps_state=2
-		[ -n "$wps_configured" ] && wps_state=1
+		[ -n "$wps_not_configured" ] && wps_state=1
 
 		[ "$ext_registrar" -gt 0 -a -n "$network_bridge" ] && append bss_conf "upnp_iface=$network_bridge" "$N"
 



More information about the lede-commits mailing list