This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot: Quieten "waiting for BOOTP" message


2005-01-05 David Vrabel <dvrabel@arcom.com>

	* src/net/bootp.c (__bootp_find_local_ip): If DHCP was being used
	the "waiting for BOOTP" message was always printed.  We only want
	to print it if we're retrying.
--
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
Index: redboot/current/src/net/bootp.c
===================================================================
RCS file: /var/cvs/ecos/packages/redboot/current/src/net/bootp.c,v
retrieving revision 1.5
diff -u -B -p -r1.5 bootp.c
--- redboot/current/src/net/bootp.c	3 Dec 2003 11:32:14 -0000	1.5
+++ redboot/current/src/net/bootp.c	5 Jan 2005 10:28:50 -0000
@@ -207,7 +207,7 @@ __bootp_find_local_ip(bootp_header_t *in
     __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 @@ __bootp_find_local_ip(bootp_header_t *in
 
 	__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 @@ __bootp_find_local_ip(bootp_header_t *in
             }
             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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]