aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-10-15 20:17:51 +0100
committerRoy Marples <roy@marples.name>2009-10-15 20:17:51 +0100
commitda08e3822fda548e39473b6ad4e5c18c55ca7bc0 (patch)
tree3e6593830196f1be15c0d841330f1aef0b572171
parentac7af858131cd496c14f591fff9cd52b82a8ed76 (diff)
Ensure ip brings interface up when adding addresses.
Fixes Gentoo #288889
-rw-r--r--init.d/network.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/init.d/network.in b/init.d/network.in
index 8b02ac4c..8233cc4f 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -103,13 +103,21 @@ dumpargs()
esac
}
+intup=false
runip()
{
local int="$1" err=
shift
err=$(LC_ALL=C ip address add "$@" dev "$int" 2>&1)
- [ -z "$err" ] && return 0
+ if [ -z "$err" ]; then
+ # ip does not bring up the interface when adding addresses
+ if ! intup; then
+ ip set link up dev "$int"
+ intup=true
+ fi
+ return 0
+ fi
if [ "$err" = "RTNETLINK answers: File exists" ]; then
ip address del "$@" dev "$int" 2>/dev/null
fi
@@ -194,7 +202,7 @@ start()
-f /etc/ifup."$int" -o -f "$cf" ] || continue
veinfo "$int"
case "$func" in
- ip) func=runip;;
+ ip) func=runip; intup=false;;
esac
eindent
runargs /etc/ifup."$int" "$upcmd"