7a655376dcc39ec0bb647dd662a8275841130db3
[openwrt-10.03/.git] / package / busybox / patches / 240-udhcpc_retries.patch
1 Index: busybox-1.7.2/networking/udhcp/dhcpc.c
2 ===================================================================
3 --- busybox-1.7.2.orig/networking/udhcp/dhcpc.c 2007-10-30 15:35:00.000000000 -0500
4 +++ busybox-1.7.2/networking/udhcp/dhcpc.c      2007-10-30 15:35:01.000000000 -0500
5 @@ -334,7 +334,7 @@
6                         /* timeout dropped to zero */
7                         switch (state) {
8                         case INIT_SELECTING:
9 -                               if (packet_num < client_config.retries) {
10 +                               if (!client_config.retries || (packet_num < client_config.retries)) {
11                                         if (packet_num == 0)
12                                                 xid = random_xid();
13  
14 @@ -360,7 +360,7 @@
15                                 break;
16                         case RENEW_REQUESTED:
17                         case REQUESTING:
18 -                               if (packet_num < client_config.retries) {
19 +                               if (!client_config.retries || (packet_num < client_config.retries)) {
20                                         /* send request packet */
21                                         if (state == RENEW_REQUESTED)
22                                                 send_renew(xid, server_addr, requested_ip); /* unicast */