mirror of
https://github.com/sheumann/hush.git
synced 2025-02-21 19:29:03 +00:00
udhcpc[6]: allow discover_retries == 0 (infinite)
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
d109798882
commit
1c7a58dfb8
@ -1111,7 +1111,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case INIT_SELECTING:
|
case INIT_SELECTING:
|
||||||
if (packet_num < discover_retries) {
|
if (!discover_retries || packet_num < discover_retries) {
|
||||||
if (packet_num == 0)
|
if (packet_num == 0)
|
||||||
xid = random_xid();
|
xid = random_xid();
|
||||||
/* multicast */
|
/* multicast */
|
||||||
@ -1140,7 +1140,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
packet_num = 0;
|
packet_num = 0;
|
||||||
continue;
|
continue;
|
||||||
case REQUESTING:
|
case REQUESTING:
|
||||||
if (packet_num < discover_retries) {
|
if (!discover_retries || packet_num < discover_retries) {
|
||||||
/* send multicast select packet */
|
/* send multicast select packet */
|
||||||
send_d6_select(xid);
|
send_d6_select(xid);
|
||||||
timeout = discover_timeout;
|
timeout = discover_timeout;
|
||||||
|
@ -1442,7 +1442,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case INIT_SELECTING:
|
case INIT_SELECTING:
|
||||||
if (packet_num < discover_retries) {
|
if (!discover_retries || packet_num < discover_retries) {
|
||||||
if (packet_num == 0)
|
if (packet_num == 0)
|
||||||
xid = random_xid();
|
xid = random_xid();
|
||||||
/* broadcast */
|
/* broadcast */
|
||||||
@ -1471,7 +1471,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
packet_num = 0;
|
packet_num = 0;
|
||||||
continue;
|
continue;
|
||||||
case REQUESTING:
|
case REQUESTING:
|
||||||
if (packet_num < discover_retries) {
|
if (!discover_retries || packet_num < discover_retries) {
|
||||||
/* send broadcast select packet */
|
/* send broadcast select packet */
|
||||||
send_select(xid, server_addr, requested_ip);
|
send_select(xid, server_addr, requested_ip);
|
||||||
timeout = discover_timeout;
|
timeout = discover_timeout;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user