This fix is needed to correctly set the driver to use with wpa_s in case of
IBSS/WPA-NONE. The current setting is not made correctly.

Signed-off-by: Antonio Quartulli <or...@autistici.org>
---
 package/hostapd/files/wpa_supplicant.sh |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/hostapd/files/wpa_supplicant.sh 
b/package/hostapd/files/wpa_supplicant.sh
index 6d2edf9..8b7460b 100644
--- a/package/hostapd/files/wpa_supplicant.sh
+++ b/package/hostapd/files/wpa_supplicant.sh
@@ -8,9 +8,6 @@ wpa_supplicant_setup_vif() {
        local scan_ssid="1"
        [ -n "$4" ] && freq="frequency=$4"
 
-       # wpa_supplicant should use wext for mac80211 cards
-       [ "$driver" = "mac80211" ] && driver='wext'
-
        # make sure we have the encryption type and the psk
        [ -n "$enc" ] || {
                config_get enc "$vif" encryption
@@ -66,7 +63,12 @@ wpa_supplicant_setup_vif() {
                ;;
                *psk*)
                        key_mgmt='WPA-PSK'
-                       [ "$mode" = "adhoc" -a "$driver" != "nl80211" ] && 
key_mgmt='WPA-NONE'
+                       # if you want to use PSK with a non-nl80211 driver you
+                       # have to use WPA-NONE and wext driver for wpa_s
+                       [ "$mode" = "adhoc" -a "$driver" != "nl80211" ] && {
+                               key_mgmt='WPA-NONE'
+                               driver='wext'
+                       }
                        config_get_bool usepassphrase "$vif" usepassphrase 1
                        if [ "$usepassphrase" = "1" ]; then
                                passphrase="psk=\"${key}\""
-- 
1.7.9.4

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to