wpa_supplicant: fix beacon_int configuration option
[openwrt.git] / package / network / services / hostapd / files / wpa_supplicant.sh
index 928243e..bd86801 100644 (file)
@@ -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
@@ -111,7 +106,7 @@ wpa_supplicant_setup_vif() {
                                        config_get password "$vif" password
                                        phase2="phase2=\"auth=${auth:-MSCHAPV2}\""
                                        identity="identity=\"$identity\""
-                                       password="password=\"$password\""
+                                       password="${password:+password=\"$password\"}"
                                ;;
                        esac
                        eap_type="eap=$(echo $eap_type | tr 'a-z' 'A-Z')"
@@ -124,13 +119,13 @@ wpa_supplicant_setup_vif() {
                ;;
        esac
 
-       local fixed_freq bssid1 beacon_interval brates mrate
+       local fixed_freq bssid1 beacon_int brates mrate
        config_get ifname "$vif" ifname
        config_get bridge "$vif" bridge
        config_get ssid "$vif" ssid
        config_get bssid "$vif" bssid
        bssid1=${bssid:+"bssid=$bssid"}
-       beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
+       beacon_int=${beacon_int:+"beacon_int=$beacon_int"}
 
        local br brval brsub brstr
        [ -n "$basic_rate_list" ] && {
@@ -168,7 +163,7 @@ network={
        $proto
        $freq
        ${fixed:+"fixed_freq=1"}
-       $beacon_interval
+       $beacon_int
        $brates
        $mrate
        $ht_str