# Handle stateful DHCPv6 like DHCPv4
[ -n "$ipv6" ] && ip="$ipv6/128"
+if [ -z "${IF_WAIT_DELAY}" ]; then
+ IF_WAIT_DELAY=10
+fi
+
+wait_for_ipv6_default_route() {
+ printf "Waiting for IPv6 default route to appear"
+ while [ $IF_WAIT_DELAY -gt 0 ]; do
+ if [ -z "$(ip -6 route list | grep default)" ]; then
+ printf "\n"
+ return
+ fi
+ sleep 1
+ printf "."
+ : $((IF_WAIT_DELAY -= 1))
+ done
+ printf " timeout!\n"
+}
+
case "$1" in
deconfig)
/sbin/ifconfig $interface up
/usr/sbin/avahi-autoipd -k $interface
fi
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+ if [ -n "$ipv6" ] ; then
+ wait_for_ipv6_default_route
+ fi
if [ -n "$router" ] ; then
echo "deleting routers"