When stopping a dhcp interface, don't just release the lease on

the address, also kill the dhclient process. Instead of doing the
release in the stop command, move it to the precmd stage and allow
rc.subr(8) to automatically kill the dhclient process by leaving the
stop command undefined.

Noticed by:	mbr
This commit is contained in:
Mike Makonnen 2003-07-26 18:50:53 +00:00
parent b44e6aad52
commit 312ba8d00a

View File

@ -23,7 +23,6 @@ FreeBSD)
rcvar=
start_precmd="dhclient_prestart"
start_postcmd="dhclient_poststart"
stop_cmd="dhclient_stop"
stop_precmd="dhclient_prestop"
stop_postcmd="dhclient_poststop"
;;
@ -73,8 +72,14 @@ dhclient_poststart()
done
}
dhclient_stop()
dhclient_prestop()
{
dhclient_common || return 1
for ifn in ${_cooked_list}; do
ipx_down ${ifn}
ifalias_down ${ifn}
done
echo -n "Releasing DHCP leases:"
for ifn in $_cooked_list ; do
${command} -r $ifn
@ -88,16 +93,6 @@ dhclient_stop()
debug "The following leases failed to release: $_fail"
}
dhclient_prestop()
{
dhclient_common || return 1
for ifn in ${_cooked_list}; do
ipx_down ${ifn}
ifalias_down ${ifn}
done
}
dhclient_poststop()
{
for ifn in ${_cooked_list}; do