tag 496570 + patch
thanks

Patch against Debian's SVN trunk for acpi-support attached.

This patch invokes ifup or ifdown just after the control file has been 
written to.  This should "un-hang" any netowrk applications.  The ifupdown 
invocations are copied from the madwifi-specific section.  Since NET_IF is 
now needed earlier, move it out a nesting level and to the top of that 
block.  Invoking ifdown before the control file is successfully written 
could end up deconfiguring the interface without powering it down.
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
[EMAIL PROTECTED]                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.org/                      \_/     
diff --git a/lib/state-funcs b/lib/state-funcs
index 11b9891..1d62af5 100644
--- a/lib/state-funcs
+++ b/lib/state-funcs
@@ -39,6 +39,7 @@ toggleAllWirelessStates()
     for DEVICE in /sys/class/net/* ; do
 	if [ -d $DEVICE/wireless ] ; then
 	    # $DEVICE is a wireless device.
+	    NET_IF=`echo $DEVICE | cut -d \/ -f 5`
 
 	    # Check if it's powered on using the official way
 	    ON=0
@@ -49,6 +50,7 @@ toggleAllWirelessStates()
 		    if [ "`cat $CONTROL`" = 0 ] ; then
 			# It's powered on. Switch it off.
 			if echo -n $OFF > $CONTROL ; then 
+			    ifdown "${NET_IF}"
 			    break
 			else
 			    OFF=2 # for power/state, second time around
@@ -56,6 +58,10 @@ toggleAllWirelessStates()
 		    else
 			# It's powered off. Switch it on.
 			if echo -n $ON > $CONTROL ; then
+			    ifup "${NET_IF}"
+			    if [ -x /sbin/wpa_cli ]; then
+				wpa_cli scan
+			    fi
 			    break
 			fi
 		    fi
@@ -64,7 +70,6 @@ toggleAllWirelessStates()
 
             # For madwifi we need to check "operstate" instead.
 	    if [ -w $DEVICE/operstate ] ; then
-	        NET_IF=`echo $DEVICE | cut -d \/ -f 5`
 	        if [ "`cat $CONTROL`" = "up" ] ; then
 		    # It's powered on. Switch it off.
 		    ifdown $NET_IF

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to