summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2008-05-15 01:06:10 +0000
committerbrooks <brooks@FreeBSD.org>2008-05-15 01:06:10 +0000
commit3a31a0cef3ad77bf9b055195367fd5217f8595d9 (patch)
treecea064b3cf9056f9f0ac35e90123c5dadbd14e11 /etc/network.subr
parent93203690b0db18a27ba088f5d3728c8ee301e089 (diff)
downloadFreeBSD-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/network.subr')
-rw-r--r--etc/network.subr23
1 files changed, 23 insertions, 0 deletions
diff --git a/etc/network.subr b/etc/network.subr
index 686f792..0a326b1 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -768,6 +768,29 @@ list_net_interfaces()
return 0
}
+# get_default_if -address_family
+# Get the interface of the default route for the given address family.
+# The -address_family argument must be suitable passing to route(8).
+#
+get_default_if()
+{
+ routeget="`route -n get $1 default 2>/dev/null`"
+ oldifs="$IFS"
+ IFS="
+"
+ defif=
+ for line in $routeget ; do
+ case $line in
+ *interface:*)
+ defif=${line##*: }
+ ;;
+ esac
+ done
+ IFS=${oldifs}
+
+ echo $defif
+}
+
hexdigit()
{
if [ $1 -lt 10 ]; then
OpenPOWER on IntegriCloud