network: wait 40 seconds for IPv6 auto configuration
authorHarald Hoyer <harald@redhat.com>
Wed, 12 Jun 2013 15:42:35 +0000 (17:42 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 12 Jun 2013 15:42:35 +0000 (17:42 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=973719

modules.d/40network/ifup.sh
modules.d/40network/net-lib.sh

index 526251f..36c6b08 100755 (executable)
@@ -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
 
index d62d5ad..f8288bb 100644 (file)
@@ -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\