summaryrefslogtreecommitdiffstats
path: root/package/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-02-08 13:42:14 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-02-08 13:42:14 +0000
commite1efddf19bec65f23ce76cd519411ccad44c53e9 (patch)
treebddbf3da6c03deae54f20d778d9300d3147e1bac /package/mac80211
parentd2cd6f3b9999359533ecd8f5b3af8ceb5d0c8d4c (diff)
downloadmaster-31e0f0ae-e1efddf19bec65f23ce76cd519411ccad44c53e9.tar.gz
master-31e0f0ae-e1efddf19bec65f23ce76cd519411ccad44c53e9.tar.bz2
master-31e0f0ae-e1efddf19bec65f23ce76cd519411ccad44c53e9.zip
mac80211: use wpa_supplicant for unencrypted connections to improve client mode reliability (patch by Stijn Tintel from #6653)
SVN-Revision: 19550
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 62b8e7ed3a..27e234d83f 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -312,6 +312,9 @@ enable_mac80211() {
local key keystring
case "$enc" in
+ *none*)
+ config_get keymgmt "$vif" keymgmt
+ ;;
*wep*)
config_get keymgmt "$vif" keymgmt
if [ -z "$keymgmt" ]; then
@@ -397,7 +400,18 @@ enable_mac80211() {
fi
;;
*)
- iw dev "$ifname" connect "$ssid" ${fixed:+$freq} $bssid
+ if [ -z "$keymgmt" ]; then
+ iw dev "$ifname" connect "$ssid" ${fixed:+$freq} $bssid
+ else
+ if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
+ wpa_supplicant_setup_vif "$vif" wext || {
+ echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2
+ # make sure this wifi interface won't accidentally stay open without encryption
+ ifconfig "$ifname" down
+ continue
+ }
+ fi
+ fi
;;
esac