Blame SOURCES/0148-network-dhclient-script-do-PREINIT6-for-DHCP6.patch

18971c
From 89f2586ae93e948cb9c41f971423431e8cccf236 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Mon, 17 Mar 2014 13:00:17 +0100
18971c
Subject: [PATCH] network:dhclient-script do PREINIT6 for DHCP6
18971c
18971c
---
18971c
 modules.d/40network/dhclient-script.sh | 29 ++++++++++++++------------
18971c
 modules.d/40network/ifup.sh            |  1 +
18971c
 2 files changed, 17 insertions(+), 13 deletions(-)
18971c
18971c
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
18971c
index 822cce95..50e89326 100755
18971c
--- a/modules.d/40network/dhclient-script.sh
18971c
+++ b/modules.d/40network/dhclient-script.sh
18971c
@@ -2,6 +2,17 @@
18971c
 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
18971c
 # ex: ts=8 sw=4 sts=4 et filetype=sh
18971c
 
18971c
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
18971c
+
18971c
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
18971c
+type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
18971c
+
18971c
+# We already need a set netif here
18971c
+netif=$interface
18971c
+
18971c
+# Huh? Interface configured?
18971c
+[ -f "/tmp/net.$netif.up" ] && exit 0
18971c
+
18971c
 setup_interface() {
18971c
     ip=$new_ip_address
18971c
     mtu=$new_interface_mtu
18971c
@@ -73,25 +84,17 @@ setup_interface6() {
18971c
     [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
18971c
 }
18971c
 
18971c
-PATH=/usr/sbin:/usr/bin:/sbin:/bin
18971c
-
18971c
-export PS4="dhclient.$interface.$$ + "
18971c
-exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
18971c
-type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
18971c
-type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
18971c
-
18971c
-# We already need a set netif here
18971c
-netif=$interface
18971c
-
18971c
-# Huh? Interface configured?
18971c
-[ -f "/tmp/net.$netif.up" ] && exit 0
18971c
-
18971c
 case $reason in
18971c
     PREINIT)
18971c
         echo "dhcp: PREINIT $netif up"
18971c
         linkup $netif
18971c
         ;;
18971c
 
18971c
+    PREINIT6)
18971c
+        echo "dhcp: PREINIT $netif up"
18971c
+        linkup $netif
18971c
+        ;;
18971c
+
18971c
     BOUND)
18971c
         echo "dhcp: BOND setting $netif"
18971c
         unset layer2
18971c
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
18971c
index 02dfc947..51b0d528 100755
18971c
--- a/modules.d/40network/ifup.sh
18971c
+++ b/modules.d/40network/ifup.sh
18971c
@@ -328,6 +328,7 @@ for p in $(getargs ip=); do
18971c
         dhcp|on|any)
18971c
             do_dhcp -4 ;;
18971c
         dhcp6)
18971c
+            load_ipv6
18971c
             do_dhcp -6 ;;
18971c
         auto6)
18971c
             do_ipv6auto ;;