mac80211: fix encryption fallback for sta mode, add frequency/bssid selection support
authorFelix Fietkau <nbd@openwrt.org>
Sun, 11 Oct 2009 01:05:17 +0000 (01:05 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 11 Oct 2009 01:05:17 +0000 (01:05 +0000)
SVN-Revision: 18025

package/mac80211/files/lib/wifi/mac80211.sh

index c11da4279b4bb75045dc35e7f74f2305b9e25e10..29c1041bfd083e985bd9d77c5cd5194b3f077f3d 100644 (file)
@@ -231,14 +231,12 @@ enable_mac80211() {
                                iw dev "$ifname" ibss join "$ssid" $freq ${fixed:+fixed-freq} $bssid
                        ;;
                        sta|mesh)
                                iw dev "$ifname" ibss join "$ssid" $freq ${fixed:+fixed-freq} $bssid
                        ;;
                        sta|mesh)
+                               config_get bssid "$vif" bssid
                                case "$enc" in                                                                                           
                                case "$enc" in                                                                                           
-                                       *)
-                                               iw dev "$ifname" connect "$ssid"
-                                       ;;
                                        wep)
                                                if [ -e "$keymgmt" ]; then
                                                        [ -n "$keystring" ] &&
                                        wep)
                                                if [ -e "$keymgmt" ]; then
                                                        [ -n "$keystring" ] &&
-                                                               iw dev "$ifname" connect "$ssid" key "$keystring"
+                                                               iw dev "$ifname" connect "$ssid" ${fixed:+$freq} $bssid key "$keystring"
                                                else
                                                        if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
                                                                wpa_supplicant_setup_vif "$vif" wext || {
                                                else
                                                        if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
                                                                wpa_supplicant_setup_vif "$vif" wext || {
@@ -260,6 +258,9 @@ enable_mac80211() {
                                                        }
                                                fi
                                        ;;
                                                        }
                                                fi
                                        ;;
+                                       *)
+                                               iw dev "$ifname" connect "$ssid" ${fixed:+$freq} $bssid
+                                       ;;
                                esac
 
                        ;;
                                esac
 
                        ;;