Harald Hoyer 0840a3
From 7cca5efdcea4f1431331cf7663fc6fb48a365cdf Mon Sep 17 00:00:00 2001
Harald Hoyer 0840a3
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 0840a3
Date: Thu, 2 Jul 2015 11:32:08 +0200
Harald Hoyer 0840a3
Subject: [PATCH] network: don't use "ifup -m"
Harald Hoyer 0840a3
Harald Hoyer 0840a3
"ifup -m" was thought to be used by humans in the emergency shell.
Harald Hoyer 0840a3
Using it programatically shows some other flaw in the execution logic.
Harald Hoyer 0840a3
Harald Hoyer 0840a3
Also, "ifup -m" was configuring the interface multiple times on "add"
Harald Hoyer 0840a3
and "change" uevent, because the "$netif.did-setup" test was not
Harald Hoyer 0840a3
executed.
Harald Hoyer 0840a3
---
Harald Hoyer 0840a3
 modules.d/40network/ifup.sh         | 3 ++-
Harald Hoyer 0840a3
 modules.d/40network/net-genrules.sh | 1 -
Harald Hoyer 0840a3
 2 files changed, 2 insertions(+), 2 deletions(-)
Harald Hoyer 0840a3
Harald Hoyer 0840a3
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
Harald Hoyer 0840a3
index de518b6..0138e01 100755
Harald Hoyer 0840a3
--- a/modules.d/40network/ifup.sh
Harald Hoyer 0840a3
+++ b/modules.d/40network/ifup.sh
Harald Hoyer 0840a3
@@ -77,9 +77,10 @@ fi
Harald Hoyer 0840a3
 # disable manual ifup while netroot is set for simplifying our logic
Harald Hoyer 0840a3
 # in netroot case we prefer netroot to bringup $netif automaticlly
Harald Hoyer 0840a3
 [ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
Harald Hoyer 0840a3
-[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
Harald Hoyer 0840a3
+
Harald Hoyer 0840a3
 if [ -n "$manualup" ]; then
Harald Hoyer 0840a3
     >/tmp/net.$netif.manualup
Harald Hoyer 0840a3
+    rm -f /tmp/net.${netif}.did-setup
Harald Hoyer 0840a3
 else
Harald Hoyer 0840a3
     [ -e /tmp/net.${netif}.did-setup ] && exit 0
Harald Hoyer 0840a3
     [ -e /sys/class/net/$netif/address ] && \
Harald Hoyer 0840a3
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
Harald Hoyer 0840a3
index 77e47b5..b1c156c 100755
Harald Hoyer 0840a3
--- a/modules.d/40network/net-genrules.sh
Harald Hoyer 0840a3
+++ b/modules.d/40network/net-genrules.sh
Harald Hoyer 0840a3
@@ -50,7 +50,6 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
Harald Hoyer 0840a3
     fi
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
     ifup='/sbin/ifup $env{INTERFACE}'
Harald Hoyer 0840a3
-    [ -z "$netroot" ] && ifup="$ifup -m"
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
     runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
Harald Hoyer 0840a3