Blame SOURCES/0137-network-IPv6-status-wait-for-tentative-flag-to-be-cl.patch

a56a5e
From 30e20744477c18a70c4f487275f2a8e957fca555 Mon Sep 17 00:00:00 2001
966cef
From: Harald Hoyer <harald@redhat.com>
966cef
Date: Thu, 27 Feb 2014 12:11:20 +0100
966cef
Subject: [PATCH] network: IPv6 status, wait for tentative flag to be cleared
966cef
966cef
also do not arping the IPv6 address.
966cef
---
966cef
 modules.d/40network/ifup.sh    |  1 +
966cef
 modules.d/40network/net-lib.sh | 16 ++++++++++++++--
966cef
 2 files changed, 15 insertions(+), 2 deletions(-)
966cef
966cef
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
1755ca
index 33ec81d1..e4391068 100755
966cef
--- a/modules.d/40network/ifup.sh
966cef
+++ b/modules.d/40network/ifup.sh
966cef
@@ -136,6 +136,7 @@ do_static() {
966cef
     if strstr $ip '*:*:*'; then
966cef
         # note no ip addr flush for ipv6
966cef
         ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
966cef
+        wait_for_ipv6_dad $netif
966cef
     else
966cef
         ip addr flush dev $netif
966cef
         ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
966cef
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
1755ca
index 4e1b0192..a5867118 100755
966cef
--- a/modules.d/40network/net-lib.sh
966cef
+++ b/modules.d/40network/net-lib.sh
966cef
@@ -123,8 +123,8 @@ setup_net() {
966cef
         read layer2 < /sys/class/net/$netif/device/layer2
966cef
     fi
966cef
 
966cef
-    if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
966cef
-        info "Resolving $dest via ARP on $netif failed"
966cef
+    if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! strstr "$dest" ":"; then
966cef
+        arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed"
966cef
     fi
966cef
     unset layer2
966cef
 
966cef
@@ -451,6 +451,18 @@ wait_for_route_ok() {
966cef
     return 1
966cef
 }
966cef
 
966cef
+wait_for_ipv6_dad() {
966cef
+    local cnt=0
966cef
+    local li
966cef
+    while [ $cnt -lt 500 ]; do
966cef
+        li=$(ip -6 addr show dev $1)
966cef
+        strstr "$li" "tentative" || return 0
966cef
+        sleep 0.1
966cef
+        cnt=$(($cnt+1))
966cef
+    done
966cef
+    return 1
966cef
+}
966cef
+
966cef
 wait_for_ipv6_auto() {
966cef
     local cnt=0
966cef
     local li