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 - Fix problems with gateway/mask setup


Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.63
diff -u -5 -p -r1.63 ChangeLog
--- redboot/current/ChangeLog	18 Jul 2002 20:05:22 -0000	1.63
+++ redboot/current/ChangeLog	30 Jul 2002 12:59:03 -0000
@@ -1,5 +1,10 @@
+2002-07-30  Gary Thomas  <gary@chez-thomas.org>
+
+	* src/net/net_io.c: Handle broadcast/mask setup better (failed if
+	not found in FLASH).  Also print on network info line.
+
 2002-07-18  Gary Thomas  <gary@chez-thomas.org>
 
 	* src/net/tftp_client.c: 
 	* src/net/http_client.c: 
 	* src/fs/disk.c: 
Index: redboot/current/src/net/ip.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/ip.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 ip.c
--- redboot/current/src/net/ip.c	9 Jul 2002 20:23:48 -0000	1.5
+++ redboot/current/src/net/ip.c	30 Jul 2002 12:49:12 -0000
@@ -7,15 +7,15 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
 // Software Foundation; either version 2 or (at your option) any later version.
-// Copyright (C) 2002 Gary Thomas
 //
 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 // for more details.
Index: redboot/current/src/net/net_io.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/net_io.c,v
retrieving revision 1.27
diff -u -5 -p -r1.27 net_io.c
--- redboot/current/src/net/net_io.c	15 Jul 2002 19:37:13 -0000	1.27
+++ redboot/current/src/net/net_io.c	30 Jul 2002 12:56:50 -0000
@@ -568,11 +568,17 @@ RedBoot_init(net_init, RedBoot_INIT_LAST
 
 static void
 show_addrs(void)
 {
     diag_printf("IP: %s", inet_ntoa((in_addr_t *)&__local_ip_addr));
-    diag_printf(", Default server: %s", inet_ntoa(&my_bootp_info.bp_siaddr));
+#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
+    diag_printf("/%s", inet_ntoa((in_addr_t *)&__local_ip_mask));
+    diag_printf(", Gateway: %s\n", inet_ntoa((in_addr_t *)&__local_ip_gate));
+#else
+    diag_printf(", ");
+#endif
+    diag_printf("Default server: %s", inet_ntoa(&my_bootp_info.bp_siaddr));
 #ifdef CYGPKG_REDBOOT_NETWORKING_DNS
     show_dns();
 #endif
     diag_printf("\n");
 }
@@ -581,18 +587,19 @@ show_addrs(void)
 static void
 flash_get_IP(char *id, ip_addr_t *val)
 {
     ip_addr_t my_ip;
     int i;
-    
-    flash_get_config(id, &my_ip, CONFIG_IP);
-    if (my_ip[0] != 0 || my_ip[1] != 0 ||
-        my_ip[2] != 0 || my_ip[3] != 0) {
-        // 'id' is set to something so let it override any static IP
-        for (i=0; i<4; i++)
-            (*val)[i] = my_ip[i];
-    }        
+
+    if (flash_get_config(id, &my_ip, CONFIG_IP)) {
+        if (my_ip[0] != 0 || my_ip[1] != 0 ||
+            my_ip[2] != 0 || my_ip[3] != 0) {
+            // 'id' is set to something so let it override any static IP
+            for (i=0; i<4; i++)
+                (*val)[i] = my_ip[i];
+        }        
+    }
 }
 #endif
 
 void
 net_init(void)




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