From: Felix Fietkau Date: Sun, 16 Dec 2012 13:33:58 +0000 (+0000) Subject: wpa_supplicant.sh: always use parameters from the current section X-Git-Tag: attitude_adjustment_12.09~73 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5fda5a54126bb9fd224542d3aa25d616a5f8edd8;p=openwrt%2Fsvn-archive%2Fopenwrt.git 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 Backport of r34716 SVN-Revision: 34717 --- diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh index 5c4bd93d02..cdca9b5539 100644 --- a/package/hostapd/files/wpa_supplicant.sh +++ b/package/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