mirror of
https://github.com/sheumann/hush.git
synced 2025-01-22 03:30:37 +00:00
udhcpc: add/edit comments, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
13ca4b12e2
commit
7d6a791ef6
@ -29,7 +29,7 @@ static smallint listen_mode;
|
|||||||
#define REQUESTING 1
|
#define REQUESTING 1
|
||||||
/* select/renew was sent, DHCPACK reply received */
|
/* select/renew was sent, DHCPACK reply received */
|
||||||
#define BOUND 2
|
#define BOUND 2
|
||||||
/* half of lease passed, want renew it by sending unicast renew requests */
|
/* half of lease passed, want to renew it by sending unicast renew requests */
|
||||||
#define RENEWING 3
|
#define RENEWING 3
|
||||||
/* renew requests were not answered, lease is almost over, send broadcast renew */
|
/* renew requests were not answered, lease is almost over, send broadcast renew */
|
||||||
#define REBINDING 4
|
#define REBINDING 4
|
||||||
@ -424,7 +424,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
state = INIT_SELECTING;
|
state = INIT_SELECTING;
|
||||||
goto leasefail;
|
goto leasefail;
|
||||||
case BOUND:
|
case BOUND:
|
||||||
/* Half of the lease passed, time to enter renewing state */
|
/* 1/2 lease passed, enter renewing state */
|
||||||
state = RENEWING;
|
state = RENEWING;
|
||||||
change_listen_mode(LISTEN_KERNEL);
|
change_listen_mode(LISTEN_KERNEL);
|
||||||
log1("Entering renew state");
|
log1("Entering renew state");
|
||||||
@ -433,7 +433,15 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
case_RENEW_REQUESTED:
|
case_RENEW_REQUESTED:
|
||||||
case RENEWING:
|
case RENEWING:
|
||||||
if (timeout > 60) {
|
if (timeout > 60) {
|
||||||
/* send an unicast renew request packet */
|
/* send an unicast renew request */
|
||||||
|
/* Sometimes observed to fail (EADDRNOTAVAIL) to bind
|
||||||
|
* a new UDP socket for sending inside send_renew.
|
||||||
|
* I hazard to guess existing listening socket
|
||||||
|
* is somehow conflicting with it, but why is it
|
||||||
|
* not deterministic then?! Strange.
|
||||||
|
* Anyway, it does recover by eventually failing throigh
|
||||||
|
* into INIT_SELECTING state.
|
||||||
|
*/
|
||||||
send_renew(xid, server_addr, requested_ip);
|
send_renew(xid, server_addr, requested_ip);
|
||||||
timeout >>= 1;
|
timeout >>= 1;
|
||||||
continue;
|
continue;
|
||||||
@ -446,7 +454,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
/* Lease is *really* about to run out,
|
/* Lease is *really* about to run out,
|
||||||
* try to find DHCP server using broadcast */
|
* try to find DHCP server using broadcast */
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
/* send a broadcast renew request packet */
|
/* send a broadcast renew request */
|
||||||
send_renew(xid, 0 /*INADDR_ANY*/, requested_ip);
|
send_renew(xid, 0 /*INADDR_ANY*/, requested_ip);
|
||||||
timeout >>= 1;
|
timeout >>= 1;
|
||||||
continue;
|
continue;
|
||||||
@ -477,7 +485,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
goto case_RENEW_REQUESTED;
|
goto case_RENEW_REQUESTED;
|
||||||
/* Start things over */
|
/* Start things over */
|
||||||
packet_num = 0;
|
packet_num = 0;
|
||||||
/* Kill any timeouts because the user wants this to hurry along */
|
/* Kill any timeouts, user wants this to hurry along */
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
continue;
|
continue;
|
||||||
case SIGUSR2:
|
case SIGUSR2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user