[git commit] udhcpc[6]: allow discover_retries == 0 (infinite)

Denys Vlasenko vda.linux at googlemail.com
Thu Sep 27 14:22:24 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=1c7a58dfb82ea04c525e0c19f94f2d800dee99e3
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Felix Fietkau <nbd at openwrt.org>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/udhcp/d6_dhcpc.c |    4 ++--
 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 dda4a91..c44220b 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)
 
 			switch (state) {
 			case INIT_SELECTING:
-				if (packet_num < discover_retries) {
+				if (!discover_retries || packet_num < discover_retries) {
 					if (packet_num == 0)
 						xid = random_xid();
 					/* multicast */
@@ -1140,7 +1140,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
 				packet_num = 0;
 				continue;
 			case REQUESTING:
-				if (packet_num < discover_retries) {
+				if (!discover_retries || packet_num < discover_retries) {
 					/* send multicast select packet */
 					send_d6_select(xid);
 					timeout = discover_timeout;
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index dcb7d42..f72217c 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1442,7 +1442,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
 
 			switch (state) {
 			case INIT_SELECTING:
-				if (packet_num < discover_retries) {
+				if (!discover_retries || packet_num < discover_retries) {
 					if (packet_num == 0)
 						xid = random_xid();
 					/* broadcast */
@@ -1471,7 +1471,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
 				packet_num = 0;
 				continue;
 			case REQUESTING:
-				if (packet_num < discover_retries) {
+				if (!discover_retries || packet_num < discover_retries) {
 					/* send broadcast select packet */
 					send_select(xid, server_addr, requested_ip);
 					timeout = discover_timeout;


More information about the busybox-cvs mailing list