Date: Wed, 20 Oct 1999 18:00:16 -0700 (PDT) From: Doug Barton <Doug@gorean.org> To: Chameleon <swen@wavefire.com> Cc: freebsd-questions@freebsd.org Subject: Re: network disconnection... Message-ID: <Pine.BSF.4.10.9910201748070.40358-200000@dt050n71.san.rr.com> In-Reply-To: <3.0.32.19991020145903.012387c0@mail.wavefire.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Before I forget, please set your mail program to wrap lines around
75 characters, thanks.
On Wed, 20 Oct 1999, Chameleon wrote:
> when i type 'dmesg' i get the following msg about 15 times:
>
> >
>
> >arpresolve: can't allocate llinfo for 127.0.0.1rt
>
> >arplookup 127.0.0.1 failed: could not allocate llinfo
This looks like you're using dhcp. A few of us are working on some
updates to the dhclient-script that ships with the system, but for now you
can comment out all the route commands that add routes for 127.* in
dhclient-script and that should solve your problem.
Alternatively you can take a look at the attached diff, which
contains most of my work in progress. There are one or two things that
need to be finished (pending some confirmation to my changes that will be
provided next time that my stupid ISP hard resets their DHCP server) but
this will give you an idea as to where I'm heading.
Good luck,
Doug
--
"Stop it, I'm gettin' misty."
- Mel Gibson as Porter, "Payback"
[-- Attachment #2 --]
--- /usr/src/contrib/isc-dhcp/client/scripts/freebsd Tue Aug 10 00:08:07 1999
+++ dhclient-script Wed Oct 20 17:57:30 1999
@@ -1,10 +1,6 @@
#!/bin/sh
-if [ -x /usr/bin/logger ]; then
- LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
-else
- LOGGER=echo
-fi
+LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
make_resolv_conf() {
echo search $new_domain_name >/etc/resolv.conf
@@ -34,20 +30,25 @@
fi
fi
-if [ x$new_network_number != x ]; then
+if [ x$new_network_number != x -a \
+ x$new_network_number != x$old_network_number ]; then
$LOGGER New Network Number: $new_network_number
fi
if [ x$new_broadcast_address != x ]; then
- $LOGGER New Broadcast Address: $new_broadcast_address
new_broadcast_arg="broadcast $new_broadcast_address"
+ if [ x$new_broadcast_address != x$old_broadcast_address ]; then
+ $LOGGER New Broadcast Address: $new_broadcast_address
+ fi
fi
if [ x$old_broadcast_address != x ]; then
old_broadcast_arg="broadcast $old_broadcast_address"
fi
if [ x$new_subnet_mask != x ]; then
- $LOGGER New Subnet Mask for $interface: $new_subnet_mask
new_netmask_arg="netmask $new_subnet_mask"
+ if [ x$new_subnet_mask != x$old_subnet_mask ]; then
+ $LOGGER New Subnet Mask for $interface: $new_subnet_mask
+ fi
fi
if [ x$old_subnet_mask != x ]; then
old_netmask_arg="netmask $old_subnet_mask"
@@ -57,6 +58,7 @@
fi
if [ x$reason = xMEDIUM ]; then
+
ifconfig $interface $medium
ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
sleep 1
@@ -66,7 +68,7 @@
if [ x$reason = xPREINIT ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
broadcast 255.255.255.255 up
@@ -83,18 +85,31 @@
if [ x$current_hostname = x ] || \
[ x$current_hostname = x$old_host_name ]; then
if [ x$new_host_name != x$old_host_name ]; then
- $LOGGER New Hostname: $new_host_name
- hostname $new_host_name
+ if [ x$new_domain_name != x ]; then
+ complete_hostname=$new_host_name.$new_domain_name
+ else
+ complete_hostname=$new_host_name
+ fi
+ $LOGGER New Hostname: $complete_hostname
+ hostname $complete_hostname
fi
fi
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
[ x$alias_ip_address != x$old_ip_address ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
- ifconfig $interface inet -alias $old_ip_address $medium
- route delete $old_ip_address 127.1 >/dev/null 2>&1
+
+#XXX - Incorrect alias syntax for freebsd
+# ifconfig $interface inet -alias $old_ip_address $medium
+# route delete $old_ip_address 127.1 >/dev/null 2>&1
+
+if [ x$reason = xBOUND ]; then
+ echo "Do I have an old_routers?: $old_routers"
+ echo "Do I have an old_ip_address?: $old_ip_address"
+fi
+
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
done
@@ -105,14 +120,27 @@
shift; shift
done
fi
- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' |sh
+ arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' | $LOGGER
+ arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' | /bin/sh
+
+elif [ x$reason = xBOUND ]; then
+$LOGGER Reason = BOUND but we skipped all the old_ip_address stuff, old_ip_address = $old_ip_address
+
fi
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
+
+ # Assume worst case scenario till we know better
+ if [ x$reason = xBOUND ]; then
+ arp -a -d
+ route flush
+ fi
+
ifconfig $interface inet $new_ip_address $new_netmask_arg \
$new_broadcast_arg $medium
- route add $new_ip_address 127.1 >/dev/null 2>&1
+# route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
+ $LOGGER New Default Router: $router
route add default $router >/dev/null 2>&1
done
if [ "$new_static_routes" != "" ]; then
@@ -127,7 +155,7 @@
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
+# 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
@@ -139,11 +167,14 @@
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
if [ x$old_ip_address != x ]; then
- ifconfig $interface inet -alias $old_ip_address $medium
- route delete $old_ip_address 127.1 >/dev/null 2>&1
+
+#XXX - Incorrect alias syntax for freebsd
+# ifconfig $interface inet -alias $old_ip_address $medium
+# route delete $old_ip_address 127.1 >/dev/null 2>&1
+
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
done
@@ -159,7 +190,7 @@
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
+# route add $alias_ip_address 127.0.0.1
fi
exit_with_hooks 0
fi
@@ -167,7 +198,7 @@
if [ x$reason = xTIMEOUT ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+# route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
ifconfig $interface inet $new_ip_address $new_netmask_arg \
$new_broadcast_arg $medium
@@ -179,9 +210,9 @@
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
+# route add $alias_ip_address 127.0.0.1
fi
- route add $new_ip_address 127.1 >/dev/null 2>&1
+# 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9910201748070.40358-200000>
