network/net-lib.sh: auto6 wait for route ra
Wait for a router advertised route
(cherry picked from commit 6d22a6860e
)
master
parent
65960fda7e
commit
e8dc8c4d89
|
@ -664,16 +664,14 @@ wait_for_ipv6_dad() {
|
||||||
|
|
||||||
wait_for_ipv6_auto() {
|
wait_for_ipv6_auto() {
|
||||||
local cnt=0
|
local cnt=0
|
||||||
local li
|
|
||||||
local timeout="$(getargs rd.net.timeout.ipv6auto=)"
|
local timeout="$(getargs rd.net.timeout.ipv6auto=)"
|
||||||
timeout=${timeout:-40}
|
timeout=${timeout:-40}
|
||||||
timeout=$(($timeout*10))
|
timeout=$(($timeout*10))
|
||||||
|
|
||||||
while [ $cnt -lt $timeout ]; do
|
while [ $cnt -lt $timeout ]; do
|
||||||
li=$(ip -6 addr show dev $1)
|
[ -z "$(ip -6 addr show dev "$1" scope global tentative)" ] \
|
||||||
if ! strstr "$li" "tentative"; then
|
&& [ -n "$(ip -6 route list proto ra dev "$1")" ] \
|
||||||
strstr "$li" "dynamic" && return 0
|
&& return 0
|
||||||
fi
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
cnt=$(($cnt+1))
|
cnt=$(($cnt+1))
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue