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

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