Skip to content

Commit

Permalink
net-lib: check if addr exists before checking for dad state
Browse files Browse the repository at this point in the history
Before we check if dad is done we should first make sure,
that there is a link local address where we do the check.

Due to this issue, on ipv6 only setups sometimes dhclient started
asking for ip address, before the link local address was present
and failed immediately.

(cherry picked from commit daa49cc)

Resolves: #1765014
  • Loading branch information
lnykryn committed Nov 29, 2019
1 parent 346e57c commit 8061a43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules.d/40network/net-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ wait_for_ipv6_dad_link() {
timeout=$(($timeout*10))

while [ $cnt -lt $timeout ]; do
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
[ -n "$(ip -6 addr show dev "$1" scope link)" ] \
&& [ -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)" ] \
Expand All @@ -671,7 +672,8 @@ wait_for_ipv6_dad() {
timeout=$(($timeout*10))

while [ $cnt -lt $timeout ]; do
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
[ -n "$(ip -6 addr show dev "$1")" ] \
&& [ -z "$(ip -6 addr show dev "$1" tentative)" ] \
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
&& return 0
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
Expand Down

0 comments on commit 8061a43

Please sign in to comment.