[PATCH] udhcpc: perform_release(): Unconditionally call deconfig script
Denys Vlasenko
vda.linux at googlemail.com
Fri Aug 26 16:53:16 UTC 2016
On Wed, Aug 24, 2016 at 12:08 PM, Peter Korsgaard <peter at korsgaard.com> wrote:
> The udhcpc script may be used to setup fallback configuration (E.G. IPv4LL,
> fixed IP address, ..) that also needs to be cleaned up on release (E.G.
> when SIGUSR2 is called or on shutdown with -R), so unconditionally call
> deconfig.
>
> Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
> ---
> networking/udhcp/dhcpc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
> index 8a16e98..799a7f9 100644
> --- a/networking/udhcp/dhcpc.c
> +++ b/networking/udhcp/dhcpc.c
> @@ -1129,9 +1129,9 @@ static void perform_release(uint32_t server_addr, uint32_t requested_ip)
> bb_error_msg("unicasting a release of %s to %s",
> inet_ntoa(temp_addr), buffer);
> send_release(server_addr, requested_ip); /* unicast */
> - udhcp_run_script(NULL, "deconfig");
> }
> bb_error_msg("entering released state");
> + udhcp_run_script(NULL, "deconfig");
>
> change_listen_mode(LISTEN_NONE);
> state = RELEASED;
Applied, thanks.
However, a more robust solution is to have process babysitter
to run some cleanup script. Imagine that udhcpc is killed with SIGKILL.
Can't handle that easily inside udhcpc...
See examples/var_service/dhcp_if/finish
More information about the busybox
mailing list