1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Do not add routes for localhost to the `dhclient' controlled interface.

Doing so is bogus if the loop-back interface was not configured.

Typically ``network_interfaces="auto"'' will return the list of
interfaces such that "lo0" is not first.  Thus there are times when
`dhclient' configs an interface before "lo0" is configured.

Under BSD4.4, there's no need to add the above route, as it will be
automatically generated by the kernel.

PR:		conf/14098, misc/15183
Submitted by:	luoqi (true identification of the problem)
This commit is contained in:
David E. O'Brien 1999-12-12 01:04:36 +00:00
parent 223b7a2363
commit 378ece9d7b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54455

View File

@ -1,5 +1,7 @@
#!/bin/sh
# $FreeBSD$
if [ -x /usr/bin/logger ]; then
LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
else
@ -111,7 +113,6 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
ifconfig $interface inet $new_ip_address $new_netmask_arg \
$new_broadcast_arg $medium
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
done
@ -127,7 +128,6 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
route add $alias_ip_address 127.0.0.1
fi
echo search $new_domain_name >/etc/resolv.conf
for nameserver in $new_domain_name_servers; do
@ -159,7 +159,6 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
fi
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
route add $alias_ip_address 127.0.0.1
fi
exit_with_hooks 0
fi
@ -179,9 +178,7 @@ if [ x$reason = xTIMEOUT ]; then
if [ x$new_ip_address != x$alias_ip_address ] && \
[ x$alias_ip_address != x ]; then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
route add $alias_ip_address 127.0.0.1
fi
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
done