diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-02-08 13:42:14 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-02-08 13:42:14 +0000 |
commit | 7be190edbde5bfb101501ac23112aca8cf22c42f (patch) | |
tree | 6cd5754f9173d280fededb38a5258ef212c44593 | |
parent | b93e15a8c5bc2c7ca78f35da9cfe8a4c1ea7e713 (diff) | |
download | upstream-7be190edbde5bfb101501ac23112aca8cf22c42f.tar.gz upstream-7be190edbde5bfb101501ac23112aca8cf22c42f.tar.bz2 upstream-7be190edbde5bfb101501ac23112aca8cf22c42f.zip |
mac80211: use wpa_supplicant for unencrypted connections to improve client mode reliability (patch by Stijn Tintel from #6653)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19550 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/hostapd/files/wpa_supplicant.sh | 3 | ||||
-rw-r--r-- | package/mac80211/files/lib/wifi/mac80211.sh | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh index 8f7f503c1f..ccf31baa90 100644 --- a/package/hostapd/files/wpa_supplicant.sh +++ b/package/hostapd/files/wpa_supplicant.sh @@ -12,6 +12,9 @@ wpa_supplicant_setup_vif() { } case "$enc" in + *none*) + key_mgmt='NONE' + ;; *wep*) key_mgmt='NONE' config_get key "$vif" key 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 |