Move the wait for a default route to rc.d/routing. Once we test for

non-dhcp interfaces to negotiate/associate this will make more sense.

This also correctly gets run after both devd and netif are run so it has
a chance of working.
This commit is contained in:
Brooks Davis 2008-05-18 02:57:54 +00:00
parent 6e535f6e5b
commit ec200b32cd
2 changed files with 27 additions and 24 deletions

View File

@ -70,29 +70,6 @@ network_start()
# Configure the interface(s).
network_common ifn_start
if [ -z "$cmdifn" ]; then
dhcp_interfaces=`list_net_interfaces dhcp`
if [ -n "${dhcp_interfaces}" ]; then
delay=${if_up_delay}
while [ ${delay} -gt 0 ]; do
defif=`get_default_if -inet`
if [ -n "${defif}" ]; then
if [ ${delay} -ne ${if_up_delay} ]; then
echo "($defif)"
fi
break
fi
if [ ${delay} -eq ${if_up_delay} ]; then
echo -n "Waiting for an interface to come up: "
else
echo -n .
fi
sleep 1
delay=`expr $delay - 1`
done
fi
fi
if [ -f /etc/rc.d/ipfilter ] ; then
# Resync ipfilter
/etc/rc.d/ipfilter quietresync

View File

@ -6,10 +6,11 @@
#
# PROVIDE: routing
# REQUIRE: netif ppp
# REQUIRE: devd netif ppp
# KEYWORD: nojail
. /etc/rc.subr
. /etc/network.subr
name="routing"
start_cmd="routing_start"
@ -22,6 +23,31 @@ routing_start()
{
static_start
options_start
# Return without waiting if we don't have dhcp interfaces.
# Once we can test that the link is actually up, we should
# remove this test and always wait.
dhcp_interfaces=`list_net_interfaces dhcp`
[ -z "`list_net_interfaces dhcp`" ] && return
# Wait for a default route
delay=${if_up_delay}
while [ ${delay} -gt 0 ]; do
defif=`get_default_if -inet`
if [ -n "${defif}" ]; then
if [ ${delay} -ne ${if_up_delay} ]; then
echo "($defif)"
fi
break
fi
if [ ${delay} -eq ${if_up_delay} ]; then
echo -n "Waiting ${delay}s for an interface to come up: "
else
echo -n .
fi
sleep 1
delay=`expr $delay - 1`
done
}
routing_stop()