From: Harald Hoyer Date: Wed, 12 Jun 2013 15:42:35 +0000 (+0200) Subject: network: wait 40 seconds for IPv6 auto configuration X-Git-Tag: 029~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b958dc624a63c48bfdf00cf11cc5d61169a099;p=thirdparty%2Fdracut.git network: wait 40 seconds for IPv6 auto configuration https://bugzilla.redhat.com/show_bug.cgi?id=973719 --- diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh index 526251f95..36c6b086a 100755 --- a/modules.d/40network/ifup.sh +++ b/modules.d/40network/ifup.sh @@ -108,6 +108,7 @@ do_ipv6auto() { echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects linkup $netif + wait_for_ipv6_auto $netif [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index d62d5adcb..f8288bbfe 100644 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -360,6 +360,18 @@ wait_for_route_ok() { return 1 } +wait_for_ipv6_auto() { + local cnt=0 + local li + while [ $cnt -lt 400 ]; do + li=$(ip -6 addr show dev $1) + strstr "$li" "dynamic" && return 0 + sleep 0.1 + cnt=$(($cnt+1)) + done + return 1 +} + linkup() { wait_for_if_link $1 2>/dev/null\ && ip link set $1 up 2>/dev/null\