fix bug with ap+sta modes using wpa
authorMike Baker <mbm@openwrt.org>
Wed, 4 Jul 2007 18:34:11 +0000 (18:34 +0000)
committerMike Baker <mbm@openwrt.org>
Wed, 4 Jul 2007 18:34:11 +0000 (18:34 +0000)
SVN-Revision: 7877

package/broadcom-wl/files/lib/wifi/broadcom.sh

index c6444d67253cc5b083cef2d8b1cf1ea2b188308b..8b021258223d3e99adda10bddd5ee48c143266b1 100644 (file)
@@ -200,17 +200,18 @@ enable_broadcom() {
                }
                [ -z "$nasopts" ] || {
                        eval "${vif}_ssid=\"\$ssid\""
-                       mode="-A"
-                       [ "$ap" = "0" ] && {
-                               mode="-S"
+                       nas_mode="-A"
+                       use_nas=1
+                       [ "$mode" = "sta" ] && {
+                               nas_mode="-S"
                                [ -z "$bridge" ] || {
                                        append vif_pre_up "supplicant 1" "$N"
                                        append vif_pre_up "passphrase $key" "$N"
                                        
-                                       nas=""
+                                       use_nas=0
                                }
                        }
-                       [ -z "$nas" ] || nas_cmd="${nas_cmd:+$nas_cmd$N}$nas -P /var/run/nas.$ifname.pid -H 34954 ${bridge:+ -l $bridge} -i $ifname $mode -m $auth -w $wsec -s \"\$${vif}_ssid\" -g 3600 $nasopts &"
+                       [ -z "$nas" -o "$use_nas" = "0" ] || nas_cmd="${nas_cmd:+$nas_cmd$N}$nas -P /var/run/nas.$ifname.pid -H 34954 ${bridge:+ -l $bridge} -i $ifname $nas_mode -m $auth -w $wsec -s \"\$${vif}_ssid\" -g 3600 $nasopts &"
                }
                _c=$(($_c + 1))
        done