diff options
author | Denys Vlasenko | 2021-06-03 16:22:35 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-06-03 16:22:35 +0200 |
commit | ecaf8e8d082b48f186be0a096764f0442b546626 (patch) | |
tree | b7dfec9079cea2816f8a9002b0efe48629483919 /networking/udhcp | |
parent | f6def87a2e73e65fb6743cb5b6d0592b390628e5 (diff) | |
download | busybox-ecaf8e8d082b48f186be0a096764f0442b546626.zip busybox-ecaf8e8d082b48f186be0a096764f0442b546626.tar.gz |
udhcpc[6]: on SIGUSR1, do not go from rebind to renew state
function old new delta
udhcpc6_main 2628 2636 +8
udhcpc_main 2556 2563 +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 15/0) Total: 15 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp')
-rw-r--r-- | networking/udhcp/d6_dhcpc.c | 10 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 1a58f5f..7f288f8 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c @@ -1517,6 +1517,9 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) if (client_data.state <= REQUESTING) /* Initial negotiations in progress, do not disturb */ break; + if (client_data.state == REBINDING) + /* Do not go back from rebind to renew state */ + break; if (lease_remaining > 30) /* if renew fails, do not go back to BOUND */ lease_remaining = 30; @@ -1524,22 +1527,21 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) packet_num = 0; switch (client_data.state) { - /* Try to renew/rebind */ case BOUND: case RENEWING: - case REBINDING: + /* Try to renew/rebind */ change_listen_mode(LISTEN_KERNEL); client_data.state = RENEW_REQUESTED; goto got_SIGUSR1; - /* Two SIGUSR1 received, start things over */ case RENEW_REQUESTED: + /* Two SIGUSR1 received, start things over */ change_listen_mode(LISTEN_NONE); d6_run_script_no_option("deconfig"); - /* Wake from SIGUSR2-induced deconfigured state */ default: /* case RELEASED: */ + /* Wake from SIGUSR2-induced deconfigured state */ change_listen_mode(LISTEN_NONE); } client_data.state = INIT_SELECTING; diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index e55b606..f388003 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -1582,6 +1582,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) if (client_data.state <= REQUESTING) /* Initial negotiations in progress, do not disturb */ break; + if (client_data.state == REBINDING) + /* Do not go back from rebind to renew state */ + break; if (lease_remaining > 30) /* if renew fails, do not go back to BOUND */ lease_remaining = 30; @@ -1589,21 +1592,20 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) packet_num = 0; switch (client_data.state) { - /* Try to renew/rebind */ case BOUND: case RENEWING: - case REBINDING: + /* Try to renew/rebind */ client_data.state = RENEW_REQUESTED; goto got_SIGUSR1; - /* Two SIGUSR1 received, start things over */ case RENEW_REQUESTED: + /* Two SIGUSR1 received, start things over */ change_listen_mode(LISTEN_NONE); d4_run_script_deconfig(); - /* Wake from SIGUSR2-induced deconfigured state */ default: /* case RELEASED: */ + /* Wake from SIGUSR2-induced deconfigured state */ change_listen_mode(LISTEN_NONE); } client_data.state = INIT_SELECTING; |