summaryrefslogtreecommitdiff
blob: 82ccc97552a7b9bfdad46fc1aff7c53962cb0eed (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
diff -u net.modules.d/ifconfig /lib/rcscripts/net.modules.d/ifconfig
--- net.modules.d/ifconfig	2005-08-30 18:49:36.000000000 +0100
+++ lib/rcscripts/net.modules.d/ifconfig	2005-09-01 07:26:36.000000000 +0100
@@ -325,7 +325,6 @@
 	local iface="$1" i=0 r e
 
 	ifconfig_exists "${iface}" true || return 1
-	ifconfig_up "${iface}"
 	
 	# Extract the config
 	local -a config=( "$@" )
@@ -360,19 +359,17 @@
 		config=( "${config[@]//peer/pointtopoint}" )
 	fi
 
+	# Ensure that the interface is up so we can add IPv6 addresses
+	interface_up "${iface}"
+
 	# Some kernels like to apply lo with an address when they are brought up
-	if [[ ${iface} == "lo" \
-		|| ${config[@]} == "127.0.0.1/8 broadcast 127.255.255.255" ]]; then
-		ifconfig "${iface}" ${config[@]} 2>/dev/null
-		r="0"
-	else
-		e=$( ifconfig "${iface}" ${config[@]} 2>&1 )
-		r="$?"
-		[[ ${r} != "0" ]] && echo "${e}" > /dev/stderr
+	if [[ ${iface} == "lo" && ${config[@]} == "127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255" ]]; then
+		ifconfig "${iface}" 0.0.0.0
 	fi
-
-	[[ ${r} != "0" || ${config[0]} == "inet6"* || ${iface} == *:* ]] \
-	&& return ${r}
+		
+	ifconfig "${iface}" ${config[@]}
+	r="$?"
+	[[ ${r} != "0" ]] && return ${r}
 
 	local metric ifvar=$( bash_variable "${iface}" )
 	# Remove the newly added route and replace with our metric