diff options
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 5ec8d39b9..c1ef19519 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -389,7 +389,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
389 | if (state == RENEW_REQUESTED) /* unicast */ | 389 | if (state == RENEW_REQUESTED) /* unicast */ |
390 | send_renew(xid, server_addr, requested_ip); | 390 | send_renew(xid, server_addr, requested_ip); |
391 | else /* broadcast */ | 391 | else /* broadcast */ |
392 | send_selecting(xid, server_addr, requested_ip); | 392 | send_select(xid, server_addr, requested_ip); |
393 | 393 | ||
394 | timeout = discover_timeout; | 394 | timeout = discover_timeout; |
395 | packet_num++; | 395 | packet_num++; |
@@ -430,7 +430,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
430 | * try to find DHCP server using broadcast */ | 430 | * try to find DHCP server using broadcast */ |
431 | if (timeout > 0) { | 431 | if (timeout > 0) { |
432 | /* send a request packet */ | 432 | /* send a request packet */ |
433 | send_renew(xid, 0, requested_ip); /* broadcast */ | 433 | send_renew(xid, 0 /* INADDR_ANY*/, requested_ip); /* broadcast */ |
434 | timeout >>= 1; | 434 | timeout >>= 1; |
435 | continue; | 435 | continue; |
436 | } | 436 | } |
@@ -529,6 +529,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
529 | if (lease_seconds < 10) /* and not too small */ | 529 | if (lease_seconds < 10) /* and not too small */ |
530 | lease_seconds = 10; | 530 | lease_seconds = 10; |
531 | } | 531 | } |
532 | //FIXME: why do we check ARP only after we've got DHCPACK? | ||
533 | //Shouldn't we do it immediately after DHCPOFFER? | ||
532 | #if ENABLE_FEATURE_UDHCPC_ARPING | 534 | #if ENABLE_FEATURE_UDHCPC_ARPING |
533 | if (opt & OPT_a) { | 535 | if (opt & OPT_a) { |
534 | if (!arpping(packet.yiaddr, | 536 | if (!arpping(packet.yiaddr, |
@@ -538,6 +540,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
538 | ) { | 540 | ) { |
539 | bb_info_msg("offered address is in use " | 541 | bb_info_msg("offered address is in use " |
540 | "(got ARP reply), declining"); | 542 | "(got ARP reply), declining"); |
543 | //NB: not clear whether it should be unicast or bcast. | ||
544 | //Currently it is a bcast. Why? | ||
541 | send_decline(xid, server_addr, packet.yiaddr); | 545 | send_decline(xid, server_addr, packet.yiaddr); |
542 | 546 | ||
543 | if (state != REQUESTING) | 547 | if (state != REQUESTING) |