changeset 1886:5f0c796f46a6

Make BOOTP/DHCP quieter - from David Vrable
author gthomas
date Tue, 01 Feb 2005 18:25:50 +0000
parents 7fd45d2a9dce
children f1416dacc556
files packages/redboot/current/ChangeLog packages/redboot/current/src/net/bootp.c
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -7,6 +7,8 @@ 2005-01-22  Andrew Lunn  <andrew.lunn@as
 2005-01-05  David Vrabel  <dvrabel@arcom.com>
 
 	* src/fs/fileio.c (do_ls): Remove useless "getcwd" message.
+ 	* src/net/bootp.c (__bootp_find_local_ip): Only print the
+ 	"waiting for BOOTP" message when after first retry.
 	
 2004-12-01  Andrea Michelotti  <amichelotti@atmel.com>
 
--- a/packages/redboot/current/src/net/bootp.c
+++ b/packages/redboot/current/src/net/bootp.c
@@ -207,7 +207,7 @@ int
     __udp_install_listener(&udp_skt, IPPORT_BOOTPC, bootp_handler);
 
     retry = MAX_RETRIES;  
-    while (!abort && (retry-- > 0)) {
+    do {
 	start = MS_TICKS();
 
         // Build up the BOOTP/DHCP request
@@ -261,6 +261,10 @@ int
 
 	__udp_send((char *)&b, txSize, &r, IPPORT_BOOTPS, IPPORT_BOOTPC);
 
+        // If we're retrying, inform the user
+        if (retry == (MAX_RETRIES-1))
+            diag_printf("... waiting for BOOTP information\n");
+
 	do {
 	    __enet_poll();
 #ifdef CYGSEM_REDBOOT_NETWORKING_DHCP
@@ -328,12 +332,7 @@ int
             }
             MS_TICKS_DELAY();  // Count for ^C test
 	} while ((MS_TICKS_DELAY() - start) < RETRY_TIME);
-
-        // Warn the user that we're polling for BOOTP info
-        if (retry == (MAX_RETRIES-1)) {
-            diag_printf("... waiting for BOOTP information\n");
-        }
-    }
+    } while (!abort && (retry-- > 0));
 
     // timed out
     __udp_remove_listener(IPPORT_BOOTPC);