Blob Blame History Raw
From 7cca5efdcea4f1431331cf7663fc6fb48a365cdf Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 2 Jul 2015 11:32:08 +0200
Subject: [PATCH] network: don't use "ifup -m"

"ifup -m" was thought to be used by humans in the emergency shell.
Using it programatically shows some other flaw in the execution logic.

Also, "ifup -m" was configuring the interface multiple times on "add"
and "change" uevent, because the "$netif.did-setup" test was not
executed.
---
 modules.d/40network/ifup.sh         | 3 ++-
 modules.d/40network/net-genrules.sh | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index de518b6..0138e01 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -77,9 +77,10 @@ fi
 # disable manual ifup while netroot is set for simplifying our logic
 # in netroot case we prefer netroot to bringup $netif automaticlly
 [ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
-[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
+
 if [ -n "$manualup" ]; then
     >/tmp/net.$netif.manualup
+    rm -f /tmp/net.${netif}.did-setup
 else
     [ -e /tmp/net.${netif}.did-setup ] && exit 0
     [ -e /sys/class/net/$netif/address ] && \
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
index 77e47b5..b1c156c 100755
--- a/modules.d/40network/net-genrules.sh
+++ b/modules.d/40network/net-genrules.sh
@@ -50,7 +50,6 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
     fi
 
     ifup='/sbin/ifup $env{INTERFACE}'
-    [ -z "$netroot" ] && ifup="$ifup -m"
 
     runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""