merge r13078-13079 to 8.09
authorFelix Fietkau <nbd@openwrt.org>
Wed, 29 Oct 2008 17:45:51 +0000 (17:45 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 29 Oct 2008 17:45:51 +0000 (17:45 +0000)
SVN-Revision: 13080

package/base-files/files/lib/network/config.sh
package/base-files/files/sbin/wifi
package/hostapd/files/hostapd.sh
package/madwifi/files/lib/wifi/madwifi.sh
package/wpa_supplicant/files/wpa_supplicant.sh

index dfee674915b8337f4a3b25000c114e09535b8368..b89168e07c7eb172160c0fd82e6bbeb3b2a14329 100755 (executable)
@@ -90,8 +90,8 @@ prepare_interface() {
        [ "br-$config" = "$iface" -o -e "$iface" ] && return 0;
        
        ifconfig "$iface" 2>/dev/null >/dev/null && {
-               # make sure the interface is removed from any existing bridge and brought down
-               ifconfig "$iface" down
+               # make sure the interface is removed from any existing bridge and deconfigured 
+               ifconfig "$iface" 0.0.0.0
                unbridge "$iface"
        }
 
index 63e132d4f1c1e9291ecf21b9b4f455dda3e1a47f..e9752c60393709f18f9246a8f4fadc7fde589b28 100755 (executable)
@@ -84,6 +84,8 @@ set_wifi_down() {
        local cfg="$1"
        local vifs vif vifstr
 
+       [ -f "/var/run/wifi-${cfg}.pid" ] &&
+               kill "$(cat "/var/run/wifi-${cfg}.pid")"
        uci_revert_state wireless "$cfg"
        config_get vifs "$cfg" vifs
        for vif in $vifs; do
index 1159c3b15646d8fadb354d473f13c1487ad9e51b..707fd8c4b8a04fd9dacc263e52787c5ab0c6c87c 100644 (file)
@@ -96,6 +96,6 @@ wpa=$wpa
 wpa_pairwise=$crypto
 $hostapd_cfg
 EOF
-       hostapd -B /var/run/hostapd-$ifname.conf
+       hostapd -P /var/run/wifi-$ifname.conf -B /var/run/hostapd-$ifname.conf
 }
 
index 6ee6435658a6446816a3052197da42934d1a2d8c..5ce288f6e634021d9106c98e30719251099db688 100755 (executable)
@@ -50,18 +50,14 @@ disable_atheros() (
        local device="$1"
 
        set_wifi_down "$device"
-       # kill all running hostapd and wpa_supplicant processes that
-       # are running on atheros vifs 
-       for pid in `pidof hostapd wpa_supplicant`; do
-               grep ath /proc/$pid/cmdline >/dev/null && \
-                       kill $pid
-       done
        
        include /lib/network
        cd /proc/sys/net
        for dev in *; do
                grep "$device" "$dev/%parent" >/dev/null 2>/dev/null && {
-                       ifconfig "$dev" down 
+                       [ -f "/var/run/wifi-${dev}.pid" ] &&
+                               kill "$(cat "/var/run/wifi-${dev}.pid")"
+                       ifconfig "$dev" down
                        unbridge "$dev"
                        wlanconfig "$dev" destroy
                }
index 37ebef7a4b4a44f53f817f25cf1f9d37899a6875..debdf811a5d1117b9c57832bd9135eb7d14e4c35 100644 (file)
@@ -75,5 +75,5 @@ network={
        $password
 }
 EOF
-       [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
+       [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
 }