aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-07-19 04:24:23 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-07-19 04:24:23 +0200
commit7d6a791ef6c6232afba765c14597153c64fecfc9 (patch)
treed92603efcea18b209282567b4f3c93b08e4834e5 /networking/udhcp/dhcpc.c
parent13ca4b12e2c7d022a1dcb5a4d9923bb176fe69a7 (diff)
downloadbusybox-w32-7d6a791ef6c6232afba765c14597153c64fecfc9.tar.gz
busybox-w32-7d6a791ef6c6232afba765c14597153c64fecfc9.tar.bz2
busybox-w32-7d6a791ef6c6232afba765c14597153c64fecfc9.zip
udhcpc: add/edit comments, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r--networking/udhcp/dhcpc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 8b6019bc9..fcc447949 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -29,7 +29,7 @@ static smallint listen_mode;
29#define REQUESTING 1 29#define REQUESTING 1
30/* select/renew was sent, DHCPACK reply received */ 30/* select/renew was sent, DHCPACK reply received */
31#define BOUND 2 31#define BOUND 2
32/* half of lease passed, want renew it by sending unicast renew requests */ 32/* half of lease passed, want to renew it by sending unicast renew requests */
33#define RENEWING 3 33#define RENEWING 3
34/* renew requests were not answered, lease is almost over, send broadcast renew */ 34/* renew requests were not answered, lease is almost over, send broadcast renew */
35#define REBINDING 4 35#define REBINDING 4
@@ -424,7 +424,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
424 state = INIT_SELECTING; 424 state = INIT_SELECTING;
425 goto leasefail; 425 goto leasefail;
426 case BOUND: 426 case BOUND:
427 /* Half of the lease passed, time to enter renewing state */ 427 /* 1/2 lease passed, enter renewing state */
428 state = RENEWING; 428 state = RENEWING;
429 change_listen_mode(LISTEN_KERNEL); 429 change_listen_mode(LISTEN_KERNEL);
430 log1("Entering renew state"); 430 log1("Entering renew state");
@@ -433,7 +433,15 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
433 case_RENEW_REQUESTED: 433 case_RENEW_REQUESTED:
434 case RENEWING: 434 case RENEWING:
435 if (timeout > 60) { 435 if (timeout > 60) {
436 /* send an unicast renew request packet */ 436 /* send an unicast renew request */
437 /* Sometimes observed to fail (EADDRNOTAVAIL) to bind
438 * a new UDP socket for sending inside send_renew.
439 * I hazard to guess existing listening socket
440 * is somehow conflicting with it, but why is it
441 * not deterministic then?! Strange.
442 * Anyway, it does recover by eventually failing throigh
443 * into INIT_SELECTING state.
444 */
437 send_renew(xid, server_addr, requested_ip); 445 send_renew(xid, server_addr, requested_ip);
438 timeout >>= 1; 446 timeout >>= 1;
439 continue; 447 continue;
@@ -446,7 +454,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
446 /* Lease is *really* about to run out, 454 /* Lease is *really* about to run out,
447 * try to find DHCP server using broadcast */ 455 * try to find DHCP server using broadcast */
448 if (timeout > 0) { 456 if (timeout > 0) {
449 /* send a broadcast renew request packet */ 457 /* send a broadcast renew request */
450 send_renew(xid, 0 /*INADDR_ANY*/, requested_ip); 458 send_renew(xid, 0 /*INADDR_ANY*/, requested_ip);
451 timeout >>= 1; 459 timeout >>= 1;
452 continue; 460 continue;
@@ -477,7 +485,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
477 goto case_RENEW_REQUESTED; 485 goto case_RENEW_REQUESTED;
478 /* Start things over */ 486 /* Start things over */
479 packet_num = 0; 487 packet_num = 0;
480 /* Kill any timeouts because the user wants this to hurry along */ 488 /* Kill any timeouts, user wants this to hurry along */
481 timeout = 0; 489 timeout = 0;
482 continue; 490 continue;
483 case SIGUSR2: 491 case SIGUSR2: