diff options
| author | Felix Fietkau <nbd@openwrt.org> | 2012-09-27 16:22:24 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-09-27 16:22:24 +0200 |
| commit | 1c7a58dfb82ea04c525e0c19f94f2d800dee99e3 (patch) | |
| tree | d7526498e61bcbb4d515905379fe1714739364f0 /networking | |
| parent | d1097988825aeec1706d86cc4941d6812735f868 (diff) | |
| download | busybox-w32-1c7a58dfb82ea04c525e0c19f94f2d800dee99e3.tar.gz busybox-w32-1c7a58dfb82ea04c525e0c19f94f2d800dee99e3.tar.bz2 busybox-w32-1c7a58dfb82ea04c525e0c19f94f2d800dee99e3.zip | |
udhcpc[6]: allow discover_retries == 0 (infinite)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
| -rw-r--r-- | networking/udhcp/d6_dhcpc.c | 4 | ||||
| -rw-r--r-- | networking/udhcp/dhcpc.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index dda4a9112..c44220bf9 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c | |||
| @@ -1111,7 +1111,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) | |||
| 1111 | 1111 | ||
| 1112 | switch (state) { | 1112 | switch (state) { |
| 1113 | case INIT_SELECTING: | 1113 | case INIT_SELECTING: |
| 1114 | if (packet_num < discover_retries) { | 1114 | if (!discover_retries || packet_num < discover_retries) { |
| 1115 | if (packet_num == 0) | 1115 | if (packet_num == 0) |
| 1116 | xid = random_xid(); | 1116 | xid = random_xid(); |
| 1117 | /* multicast */ | 1117 | /* multicast */ |
| @@ -1140,7 +1140,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) | |||
| 1140 | packet_num = 0; | 1140 | packet_num = 0; |
| 1141 | continue; | 1141 | continue; |
| 1142 | case REQUESTING: | 1142 | case REQUESTING: |
| 1143 | if (packet_num < discover_retries) { | 1143 | if (!discover_retries || packet_num < discover_retries) { |
| 1144 | /* send multicast select packet */ | 1144 | /* send multicast select packet */ |
| 1145 | send_d6_select(xid); | 1145 | send_d6_select(xid); |
| 1146 | timeout = discover_timeout; | 1146 | timeout = discover_timeout; |
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index dcb7d42dc..f72217c84 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
| @@ -1442,7 +1442,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
| 1442 | 1442 | ||
| 1443 | switch (state) { | 1443 | switch (state) { |
| 1444 | case INIT_SELECTING: | 1444 | case INIT_SELECTING: |
| 1445 | if (packet_num < discover_retries) { | 1445 | if (!discover_retries || packet_num < discover_retries) { |
| 1446 | if (packet_num == 0) | 1446 | if (packet_num == 0) |
| 1447 | xid = random_xid(); | 1447 | xid = random_xid(); |
| 1448 | /* broadcast */ | 1448 | /* broadcast */ |
| @@ -1471,7 +1471,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
| 1471 | packet_num = 0; | 1471 | packet_num = 0; |
| 1472 | continue; | 1472 | continue; |
| 1473 | case REQUESTING: | 1473 | case REQUESTING: |
| 1474 | if (packet_num < discover_retries) { | 1474 | if (!discover_retries || packet_num < discover_retries) { |
| 1475 | /* send broadcast select packet */ | 1475 | /* send broadcast select packet */ |
| 1476 | send_select(xid, server_addr, requested_ip); | 1476 | send_select(xid, server_addr, requested_ip); |
| 1477 | timeout = discover_timeout; | 1477 | timeout = discover_timeout; |
