diff options
author | brooks <brooks@FreeBSD.org> | 2008-05-15 01:06:10 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2008-05-15 01:06:10 +0000 |
commit | 3a31a0cef3ad77bf9b055195367fd5217f8595d9 (patch) | |
tree | cea064b3cf9056f9f0ac35e90123c5dadbd14e11 /etc/rc.d/netif | |
parent | 93203690b0db18a27ba088f5d3728c8ee301e089 (diff) | |
download | FreeBSD-src-3a31a0cef3ad77bf9b055195367fd5217f8595d9.zip FreeBSD-src-3a31a0cef3ad77bf9b055195367fd5217f8595d9.tar.gz |
Change the default value of synchronous_dhclient to NO.
To preserve the existing behavior of etc/rc.d/netif, add code to wait
up to if_up_delay seconds (30 seconds by default) for a default route to
be configured if there are any dhcp interfaces. This should be extended
to test that the interface is actually up.
X-MFC after:
Diffstat (limited to 'etc/rc.d/netif')
-rw-r--r-- | etc/rc.d/netif | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif index 8298da4..37e0f13 100644 --- a/etc/rc.d/netif +++ b/etc/rc.d/netif @@ -70,6 +70,29 @@ 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 |