Blame 0137-network-ifup-do-DHCP-for-BOOTDEV.patch

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