summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/network.sh
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2011-12-20 13:19:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-03 12:14:27 +0000
commite412dbf6cd67702bb50126a0f5ab9aecbe9c90bf (patch)
treeab1edacb91a0d7ffcee38a146bf964b88dbc5f4b /meta/recipes-core/udev/udev/network.sh
parent005b67f2824aeb207bef0c054d8ffa38d94ae87e (diff)
downloadpoky-e412dbf6cd67702bb50126a0f5ab9aecbe9c90bf.tar.gz
udev: reorganize files of 164 version
We merged both files and udev-164 directory onto a single directory and renamed udev-new.inc onto udev.inc as we have a single version of udev now. (From OE-Core rev: abde2a045a39a70a6247a7ae591a131120ab8ed3) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev/udev/network.sh')
-rw-r--r--meta/recipes-core/udev/udev/network.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev/network.sh b/meta/recipes-core/udev/udev/network.sh
new file mode 100644
index 0000000000..5016328df4
--- /dev/null
+++ b/meta/recipes-core/udev/udev/network.sh
@@ -0,0 +1,55 @@
1#!/bin/sh
2
3# Do not run when pcmcia-cs is installed
4test -x /sbin/cardctl && exit 0
5
6# We get two "add" events for hostap cards due to wifi0
7echo "$INTERFACE" | grep -q wifi && exit 0
8
9
10# Check if /etc/init.d/network has been run yet to see if we are
11# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
12#
13# At this stage, network interfaces should not be brought up
14# automatically because:
15# a) /etc/init.d/network has not been run yet (security issue)
16# b) /var has not been populated yet so /etc/resolv,conf points to
17# oblivion, making the network unusable
18#
19
20spoofp="`grep ^spoofprotect /etc/network/options`"
21if test -z "$spoofp"
22then
23 # This is the default from /etc/init.d/network
24 spoofp_val=yes
25else
26 spoofp_val=${spoofp#spoofprotect=}
27fi
28
29test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
30
31# I think it is safe to assume that "lo" will always be there ;)
32if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
33then
34 echo "$INTERFACE" >> /dev/udev_network_queue
35 exit 0
36fi
37
38#
39# Code taken from pcmcia-cs:/etc/pcmcia/network
40#
41
42# if this interface has an entry in /etc/network/interfaces, let ifupdown
43# handle it
44if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
45 case $ACTION in
46 add)
47 ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
48 ;;
49 remove)
50 ifdown $INTERFACE
51 ;;
52 esac
53
54 exit 0
55fi