X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/ca0a92a8f5bce255c1a195533644d39750b5109d..2010214af9648411dbeffa9a462dd2a80b349651:/package/hostapd/files/wpa_supplicant.sh diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh index 9446202be..9c475a8fb 100644 --- a/package/hostapd/files/wpa_supplicant.sh +++ b/package/hostapd/files/wpa_supplicant.sh @@ -3,6 +3,8 @@ wpa_supplicant_setup_vif() { local driver="$2" local key="$key" local options="$3" + local freq="" + [ -n "$4" ] && freq="frequency=$4" # wpa_supplicant should use wext for mac80211 cards [ "$driver" = "mac80211" ] && driver='wext' @@ -23,7 +25,7 @@ wpa_supplicant_setup_vif() { config_set "$vif" bridge "$bridge" } - local mode ifname wds + local mode ifname wds modestr="" config_get mode "$vif" mode config_get ifname "$vif" ifname config_get_bool wds "$vif" wds 0 @@ -31,13 +33,12 @@ wpa_supplicant_setup_vif() { echo "wpa_supplicant_setup_vif($ifname): Refusing to bridge $mode mode interface" return 1 } + [ "$mode" = "adhoc" ] && modestr="mode=1" + key_mgmt='NONE' case "$enc" in - *none*) - key_mgmt='NONE' - ;; + *none*) ;; *wep*) - key_mgmt='NONE' config_get key "$vif" key key="${key:-1}" case "$key" in @@ -59,7 +60,8 @@ wpa_supplicant_setup_vif() { ;; *psk*) key_mgmt='WPA-PSK' - config_get_bool usepassphrase "$vif" passphrase 1 + [ "$mode" = "adhoc" -a "$driver" != "nl80211" ] && key_mgmt='WPA-NONE' + config_get_bool usepassphrase "$vif" usepassphrase 1 if [ "$usepassphrase" = "1" ]; then passphrase="psk=\"${key}\"" else @@ -123,11 +125,13 @@ wpa_supplicant_setup_vif() { cat > /var/run/wpa_supplicant-$ifname.conf <