7414ca
From 6b827761075266ebaf1ef10cc0a640445f02dbe1 Mon Sep 17 00:00:00 2001
7414ca
From: Lukas Nykryn <lnykryn@redhat.com>
7414ca
Date: Mon, 7 Oct 2019 16:48:09 +0200
7414ca
Subject: [PATCH] net-lib: check if addr exists before checking for dad state
7414ca
7414ca
Before we check if dad is done we should first make sure,
7414ca
that there is a link local address where we do the check.
7414ca
7414ca
Due to this issue, on ipv6 only setups sometimes dhclient started
7414ca
asking for ip address, before the link local address was present
7414ca
and failed immediately.
7414ca
---
7414ca
 modules.d/40network/net-lib.sh | 2 ++
7414ca
 1 file changed, 2 insertions(+)
7414ca
7414ca
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
7414ca
index 35e6e833..3f2fc712 100755
7414ca
--- a/modules.d/40network/net-lib.sh
7414ca
+++ b/modules.d/40network/net-lib.sh
7414ca
@@ -645,6 +645,7 @@ wait_for_ipv6_dad_link() {
7414ca
     timeout=$(($timeout*10))
7414ca
 
7414ca
     while [ $cnt -lt $timeout ]; do
7414ca
+        [ -n "$(ip -6 addr show dev "$1" scope link)" ] \
7414ca
         [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
7414ca
             && return 0
7414ca
         [ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
7414ca
@@ -662,6 +663,7 @@ wait_for_ipv6_dad() {
7414ca
     timeout=$(($timeout*10))
7414ca
 
7414ca
     while [ $cnt -lt $timeout ]; do
7414ca
+        [ -n "$(ip -6 addr show dev "$1")" ] \
7414ca
         [ -z "$(ip -6 addr show dev "$1" tentative)" ] \
7414ca
             && return 0
7414ca
         [ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \