From b1f35e43b1181950f9e9b7ada28e8c71fee5e7c6 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Tue, 10 Jan 2006 05:33:33 +0000 Subject: [PATCH] When we give up on an interface, use the arp(8) command to remove all entries from the interface rather than using ifconfig's delete command. This preserves non-dhclient configured addresses (though they are wiped out when dhclient is restarted). MFC after: 1 week --- sbin/dhclient/dhclient-script | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script index fbf6e39a63b1..fd1fd61ef05a 100644 --- a/sbin/dhclient/dhclient-script +++ b/sbin/dhclient/dhclient-script @@ -19,9 +19,10 @@ # # -NETSTAT=/usr/bin/netstat +ARP=/usr/sbin/arp AWK=/usr/bin/awk HOSTNAME=/bin/hostname +NETSTAT=/usr/bin/netstat LOCALHOST=127.0.0.1 @@ -257,7 +258,9 @@ EXPIRE|FAIL) delete_old_address delete_old_routes fi - ifconfig $interface delete + if [ -x $ARP ]; then + $ARP -d -a -i $interface + fi # XXX Why add alias we just deleted above? add_new_alias if [ -f /etc/resolv.conf.save ]; then