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

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