aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-09-28 14:44:09 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-09-28 14:44:09 +0200
commitaae428f0bf0fcd6cd0a2503b3a50de43785b8fd0 (patch)
treeea72c9526278a93caa1d73c1a469e00fba3b980a /networking/udhcp/dhcpc.c
parent702d865fe6ab84c1179275beda6c31f7adaeafa1 (diff)
downloadbusybox-aae428f0bf0fcd6cd0a2503b3a50de43785b8fd0.tar.gz
udhcpc: give SIGUSR1-induced renew one chance of unicast renew
The caps were inconsistent: timeout to renew was capped at 20 seconds, and any renews with timeout <= 60 seconds were forced to broadcast. function old new delta udhcpc_main 2683 2680 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 0310663e0..ab3e5a463 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1519,7 +1519,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
case RENEW_REQUESTED: /* manual (SIGUSR1) renew */
case_RENEW_REQUESTED:
case RENEWING:
- if (timeout > 60) {
+ if (timeout >= 60) {
/* send an unicast renew request */
/* Sometimes observed to fail (EADDRNOTAVAIL) to bind
* a new UDP socket for sending inside send_renew.
@@ -1592,11 +1592,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
* For the second case, must make sure timeout
* is not too big, or else we can send
* futile renew requests for hours.
- * (Ab)use -A TIMEOUT value (usually 20 sec)
- * as a cap on the timeout.
*/
- if (timeout > tryagain_timeout)
- timeout = tryagain_timeout;
+ if (timeout > 60)
+ timeout = 60;
goto case_RENEW_REQUESTED;
}
/* Start things over */