aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/netif23
-rw-r--r--etc/rc.d/routing28
2 files changed, 27 insertions, 24 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index 37e0f13cf4c0..8298da495d81 100644
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -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
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index 874eda517458..33424fd4a828 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -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()