From 2b38b9a3e63e5a8be3aad3edca2918880ecf327f Mon Sep 17 00:00:00 2001 From: nbd Date: Sun, 16 Dec 2012 13:23:37 +0000 Subject: [PATCH] wpa_supplicant.sh: always use parameters from the current section Using variables from the outer scope unnecessarily complicates the code and leads to issues. This patch fixes the bug when having an "adhoc" wifi-iface section before a "sta" section prevents wpa_supplicant from using the key specified in the corresponding section as it tries to use the "adhoc" key instead (1 by default). Signed-off-by: Paul Fertser git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34716 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/network/services/hostapd/files/wpa_supplicant.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/package/network/services/hostapd/files/wpa_supplicant.sh b/package/network/services/hostapd/files/wpa_supplicant.sh index 928243e425..127c5a70f5 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.sh +++ b/package/network/services/hostapd/files/wpa_supplicant.sh @@ -9,13 +9,8 @@ wpa_supplicant_setup_vif() { local scan_ssid="1" [ -n "$4" ] && freq="frequency=$4" - # make sure we have the encryption type and the psk - [ -n "$enc" ] || { - config_get enc "$vif" encryption - } - [ -n "$key" ] || { - config_get key "$vif" key - } + config_get enc "$vif" encryption + config_get key "$vif" key local net_cfg bridge config_get bridge "$vif" bridge -- 2.11.0