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:
parent
f9dbf2049c
commit
5734a09941
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user