summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/pcmcia-cs/pcmcia-cs-3.2.8/network.patch
blob: fb808e209c09e9d47d0a3cc9c9da290bd76a6ccf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
--- pcmcia-cs/etc/network.old	2004-07-01 00:31:59.000000000 +0100
+++ pcmcia-cs/etc/network	2004-07-01 00:32:57.000000000 +0100
@@ -31,16 +31,39 @@
 
 RESOLV=/etc/resolv.conf
 
+# if this interface has an entry in /etc/network/interfaces, let ifupdown
+# handle it
+if grep -q "iface \+$DEVICE" /etc/network/interfaces; then
+  case $ACTION in
+    start)
+    	ifup $DEVICE
+    	;;
+    stop)
+    	ifdown $DEVICE
+    	;;
+    restart)
+    	ifdown $DEVICE
+    	ifup $DEVICE
+    	;;
+  esac
+  
+  exit 0
+fi
+
+## see if it is a wireless card. Jamey and AntiProxy
+CHECK_WIRELESS=`grep "$DEVICE" /proc/net/wireless`
+if [ -n "$CHECK_WIRELESS" ] ; then
 # Now, run the specific script for Wireless LAN interfaces
 # Note : we need the wireless parameters to be set up before IP parameters,
 # so that we can perform DHCP over the Wireless link if needed. Jean II
-O_INFO=$INFO ; INFO=
-if [ -x ./wireless ] ; then
-    . ./wireless
-else
-    . /etc/pcmcia/wireless
+    O_INFO=$INFO ; INFO=
+    if [ -x ./wireless ] ; then
+	. ./wireless
+    else
+	. /etc/pcmcia/wireless
+    fi
+    INFO=$O_INFO
 fi
-INFO=$O_INFO
 
 bootp_setup ()
 {
@@ +225,6 -188,11 @@
 		fi
 		/sbin/dhcpcd -XYZZY 2>&1 | grep -q DHCP || \
 		    rm -f /var/run/dhcpcd-$DEVICE.pid
+  	    # modified for udhcpc
+	    elif [ -x /sbin/udhcpc ] ; then
+		PID=`cat /var/run/udhcpc.$DEVICE.pid 2>/dev/null`
+		if [ -n "$PID" ] ; then kill -TERM $PID ; fi
+	    # end of modification
 	    elif [ -x /sbin/dhclient ] ; then
 		PID=`cat /var/run/dhclient.pid 2>/dev/null`
 		if [ -n "$PID" ] ; then kill -TERM $PID ; fi
@@ +282,7 -250,30 @@
     [ -n "$IPADDR" ] && /sbin/ifconfig $DEVICE down up
     ;;
 
+'resume')
+    #logger RESUME EVENT PCMCIA SEEN FROM CARDMGR
+    if [ -z "$IPADDR" ] || is_true $DHCP ; then
+        if [ ! -x /sbin/dhcpcd ] && [ -x /sbin/udhcpc ] ; then
+              PID=`cat /var/run/udhcpc.$DEVICE.pid 2>/dev/null`
+              if [ -n "$PID" ] ; then
+                 kill -USR1 $PID
+              fi
+        fi
+    fi
+    ;;
+    
+'suspend')
+    #logger SUSPEND EVENT SEEN FROM CARDMGR
+# ## uncomment this code below if you get problems where
+# ## you are getting in IP conflict upon resume on DHCP networks
+#    if [ -z "$IPADDR" ] || is_true $DHCP ; then
+#        if [ ! -x /sbin/dhcpcd ] && [ -x /sbin/udhcpc ] ; then
+#	      PID=`cat /var/run/udhcpc.$DEVICE.pid 2>/dev/null`
+#       	      if [ -n "$PID" ] ; then
+#                 ifconfig $DEVICE 0.0.0.0
+#              fi
+#        fi
+#    fi
-'suspend'|'resume')
     ;;
 
 *)