Browse Source

network:dhclient-script do PREINIT6 for DHCP6

master
Harald Hoyer 11 years ago
parent
commit
a9d30a4066
  1. 29
      modules.d/40network/dhclient-script.sh
  2. 1
      modules.d/40network/ifup.sh

29
modules.d/40network/dhclient-script.sh

@ -2,6 +2,17 @@ @@ -2,6 +2,17 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

PATH=/usr/sbin:/usr/bin:/sbin:/bin

type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh

# We already need a set netif here
netif=$interface

# Huh? Interface configured?
[ -f "/tmp/net.$netif.up" ] && exit 0

setup_interface() {
ip=$new_ip_address
mtu=$new_interface_mtu
@ -73,25 +84,17 @@ setup_interface6() { @@ -73,25 +84,17 @@ setup_interface6() {
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}

PATH=/usr/sbin:/usr/bin:/sbin:/bin

export PS4="dhclient.$interface.$$ + "
[ -e /run/initramfs/loginit.pipe ] && exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh

# We already need a set netif here
netif=$interface

# Huh? Interface configured?
[ -f "/tmp/net.$netif.up" ] && exit 0

case $reason in
PREINIT)
echo "dhcp: PREINIT $netif up"
linkup $netif
;;

PREINIT6)
echo "dhcp: PREINIT $netif up"
linkup $netif
;;

BOUND)
echo "dhcp: BOND setting $netif"
unset layer2

1
modules.d/40network/ifup.sh

@ -328,6 +328,7 @@ for p in $(getargs ip=); do @@ -328,6 +328,7 @@ for p in $(getargs ip=); do
dhcp|on|any)
do_dhcp -4 ;;
dhcp6)
load_ipv6
do_dhcp -6 ;;
auto6)
do_ipv6auto ;;

Loading…
Cancel
Save