network: differ between ipv6 local and global tentative
For dhcpv6, only a non-tentative scope local address is needed.
(cherry picked from commit 42dd8928a8
)
master
parent
5401d1f86f
commit
811a070d6c
|
@ -158,7 +158,7 @@ case $reason in
|
||||||
PREINIT6)
|
PREINIT6)
|
||||||
echo "dhcp: PREINIT6 $netif up"
|
echo "dhcp: PREINIT6 $netif up"
|
||||||
linkup $netif
|
linkup $netif
|
||||||
wait_for_ipv6_dad $netif
|
wait_for_ipv6_dad_link $netif
|
||||||
;;
|
;;
|
||||||
|
|
||||||
BOUND)
|
BOUND)
|
||||||
|
|
|
@ -646,16 +646,34 @@ wait_for_route_ok() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_for_ipv6_dad() {
|
wait_for_ipv6_dad_link() {
|
||||||
local cnt=0
|
local cnt=0
|
||||||
local li
|
|
||||||
local timeout="$(getargs rd.net.timeout.ipv6dad=)"
|
local timeout="$(getargs rd.net.timeout.ipv6dad=)"
|
||||||
timeout=${timeout:-50}
|
timeout=${timeout:-50}
|
||||||
timeout=$(($timeout*10))
|
timeout=$(($timeout*10))
|
||||||
|
|
||||||
while [ $cnt -lt $timeout ]; do
|
while [ $cnt -lt $timeout ]; do
|
||||||
li=$(ip -6 addr show dev $1 scope link)
|
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||||
strstr "$li" "tentative" || return 0
|
&& return 0
|
||||||
|
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||||
|
&& return 1
|
||||||
|
sleep 0.1
|
||||||
|
cnt=$(($cnt+1))
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_ipv6_dad() {
|
||||||
|
local cnt=0
|
||||||
|
local timeout="$(getargs rd.net.timeout.ipv6dad=)"
|
||||||
|
timeout=${timeout:-50}
|
||||||
|
timeout=$(($timeout*10))
|
||||||
|
|
||||||
|
while [ $cnt -lt $timeout ]; do
|
||||||
|
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||||
|
&& return 0
|
||||||
|
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
|
||||||
|
&& return 1
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
cnt=$(($cnt+1))
|
cnt=$(($cnt+1))
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue