diff options
Diffstat (limited to 'meta/recipes-core/udev/udev/network.sh')
-rw-r--r-- | meta/recipes-core/udev/udev/network.sh | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/meta/recipes-core/udev/udev/network.sh b/meta/recipes-core/udev/udev/network.sh deleted file mode 100644 index bccd422dbf..0000000000 --- a/meta/recipes-core/udev/udev/network.sh +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # We get two "add" events for hostap cards due to wifi0 | ||
4 | echo "$INTERFACE" | grep -q wifi && exit 0 | ||
5 | |||
6 | |||
7 | # Check if /etc/init.d/network has been run yet to see if we are | ||
8 | # called by starting /etc/rcS.d/S03udev and not by hotplugging a device | ||
9 | # | ||
10 | # At this stage, network interfaces should not be brought up | ||
11 | # automatically because: | ||
12 | # a) /etc/init.d/network has not been run yet (security issue) | ||
13 | # b) /var has not been populated yet so /etc/resolv,conf points to | ||
14 | # oblivion, making the network unusable | ||
15 | # | ||
16 | |||
17 | spoofp="`grep ^spoofprotect /etc/network/options`" | ||
18 | if test -z "$spoofp" | ||
19 | then | ||
20 | # This is the default from /etc/init.d/network | ||
21 | spoofp_val=yes | ||
22 | else | ||
23 | spoofp_val=${spoofp#spoofprotect=} | ||
24 | fi | ||
25 | |||
26 | test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0 | ||
27 | |||
28 | # I think it is safe to assume that "lo" will always be there ;) | ||
29 | if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val" | ||
30 | then | ||
31 | echo "$INTERFACE" >> /dev/udev_network_queue | ||
32 | exit 0 | ||
33 | fi | ||
34 | |||
35 | # | ||
36 | # Code taken from pcmcia-cs:/etc/pcmcia/network | ||
37 | # | ||
38 | |||
39 | # if this interface has an entry in /etc/network/interfaces, let ifupdown | ||
40 | # handle it | ||
41 | if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then | ||
42 | case $ACTION in | ||
43 | add) | ||
44 | ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE | ||
45 | ;; | ||
46 | remove) | ||
47 | ifdown $INTERFACE | ||
48 | ;; | ||
49 | esac | ||
50 | |||
51 | exit 0 | ||
52 | fi | ||