Blob Blame History Raw
From 96b708e178930b0891daab8dcc9d1d7375637a29 Mon Sep 17 00:00:00 2001
From: pallotron <pallotron@fb.com>
Date: Wed, 5 Apr 2017 00:15:16 -0700
Subject: [PATCH] more ipv6 improvements

---
 modules.d/40network/net-lib.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index b74fdbdd..e0f761f3 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -653,7 +653,9 @@ wait_for_ipv6_dad_link() {
     timeout=$(($timeout*10))
 
     while [ $cnt -lt $timeout ]; do
+        echo "wait_for_ipv6_dad_link..." 1>&2
         [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
+            && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
             && return 0
         [ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
             && return 1
@@ -670,8 +672,9 @@ wait_for_ipv6_dad() {
     timeout=$(($timeout*10))
 
     while [ $cnt -lt $timeout ]; do
+        echo "wait_for_ipv6_dad..." 1>&2
         [ -z "$(ip -6 addr show dev "$1" tentative)" ] \
-            && [ -n "$(ip -6 route list proto ra dev "$1")" ] \
+            && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
             && return 0
         [ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
             && return 1
@@ -688,8 +691,9 @@ wait_for_ipv6_auto() {
     timeout=$(($timeout*10))
 
     while [ $cnt -lt $timeout ]; do
+        echo "wait_for_ipv6_auto..." 1>&2
         [ -z "$(ip -6 addr show dev "$1" tentative)" ] \
-            && [ -n "$(ip -6 route list proto ra dev "$1")" ] \
+            && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
             && return 0
         sleep 0.1
         cnt=$(($cnt+1))