aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/d6_dhcpc.c
diff options
context:
space:
mode:
authorPeter Korsgaard <peter@korsgaard.com>2016-08-26 18:46:34 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-08-26 18:46:34 +0200
commitb6355e2bb5c931413735b7df2964e20e050bbc07 (patch)
tree3b05bb9db066f33c267adb4b2b607f725cb06eb6 /networking/udhcp/d6_dhcpc.c
parent0dddbc1a59795a77679d8c5ef48a2795cb470563 (diff)
downloadbusybox-b6355e2bb5c931413735b7df2964e20e050bbc07.tar.gz
udhcpc: Unconditionally call deconfig script, not only if lease is active
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@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/d6_dhcpc.c')
-rw-r--r--networking/udhcp/d6_dhcpc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index 6ff040d9e..ddf3412a0 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -800,10 +800,15 @@ static void perform_d6_release(struct in6_addr *server_ipv6, struct in6_addr *ou
) {
bb_error_msg("unicasting a release");
send_d6_release(server_ipv6, our_cur_ipv6); /* unicast */
- d6_run_script(NULL, "deconfig");
}
bb_error_msg("entering released state");
-
+/*
+ * We can be here on: SIGUSR2,
+ * or on exit (SIGTERM) and -R "release on quit" is specified.
+ * Users requested to be notified in all cases, even if not in one
+ * of the states above.
+ */
+ d6_run_script(NULL, "deconfig");
change_listen_mode(LISTEN_NONE);
state = RELEASED;
}