From da08e3822fda548e39473b6ad4e5c18c55ca7bc0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 15 Oct 2009 20:17:51 +0100 Subject: Ensure ip brings interface up when adding addresses. Fixes Gentoo #288889 --- init.d/network.in | 12 ++++++++++-- 1 file 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" -- cgit v1.2.3