File 0616-ifup.sh-several-fixes-for-dhcp-calls-with-multiple-n.patch of Package dracut.12460

From b2d7ded290e13d275301508b56a21817a2283cf3 Mon Sep 17 00:00:00 2001
From: Thomas Blume <Thomas.Blume@suse.com>
Date: Thu, 26 Sep 2019 14:32:25 +0200
Subject: [PATCH 1/3] ifup.sh: several fixes for dhcp calls with multiple nics

---
 modules.d/40network/ifup.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 571d014b..7ae84bf8 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -576,6 +576,11 @@ for p in $(getargs ip=); do
     done
 
     if [ $? -eq 0 ]; then
+        > /tmp/net.$netif.did-setup
+       [ -z "$DO_VLAN" ] && \
+       [ -e /sys/class/net/$netif/address ] && \
+       > /tmp/net.$(cat /sys/class/net/$netif/address).did-setup
+
         bring_online
     fi
 done
@@ -600,11 +605,11 @@ if [ ! -e /tmp/net.${netif}.up ]; then
             load_ipv6
             do_dhcp -6
         fi
-        if getargs 'ip=dhcp'; then
+        if getargs 'ip=dhcp' && [ "$autoconf" != "dhcp" ]; then
             do_dhcp -4
         fi
     fi
-    if [ $? -eq 0 ]; then
+    if [ $? -eq 0 ] && [ -f /tmp/leaseinfo.${netif}* ]; then
         bring_online
     fi
 fi
-- 
2.16.4

openSUSE Build Service is sponsored by