Blame SOURCES/0332-network-ifup-do-DHCP-for-BOOTDEV.patch

64b87c
From 7316d68353cfd6e08f007d10ea3e32fa4d083487 Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Tue, 1 Sep 2015 19:05:37 +0200
64b87c
Subject: [PATCH] network/ifup: do DHCP for BOOTDEV
64b87c
64b87c
---
64b87c
 modules.d/40network/ifup.sh | 19 ++++++++++++++-----
64b87c
 1 file changed, 14 insertions(+), 5 deletions(-)
64b87c
64b87c
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
1755ca
index db9fb085..0471c425 100755
64b87c
--- a/modules.d/40network/ifup.sh
64b87c
+++ b/modules.d/40network/ifup.sh
64b87c
@@ -430,11 +430,20 @@ fi
64b87c
 
64b87c
 # no ip option directed at our interface?
64b87c
 if [ ! -e /tmp/net.${netif}.up ]; then
64b87c
-    if getargs 'ip=dhcp6'; then
64b87c
-        load_ipv6
64b87c
-        do_dhcp -6
64b87c
-    elif getargs 'ip=dhcp'; then
64b87c
-        do_dhcp -4
64b87c
+    if [ -e /tmp/net.bootdev ]; then
64b87c
+        BOOTDEV=$(cat /tmp/net.bootdev)
64b87c
+        if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
64b87c
+            load_ipv6
64b87c
+            do_dhcp
64b87c
+        fi
64b87c
+    else
64b87c
+        if getargs 'ip=dhcp6'; then
64b87c
+            load_ipv6
64b87c
+            do_dhcp -6
64b87c
+        fi
64b87c
+        if getargs 'ip=dhcp'; then
64b87c
+            do_dhcp -4
64b87c
+        fi
64b87c
     fi
64b87c
 fi
64b87c