This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
RedBoot: ip_address crash
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Wed, 24 May 2006 06:26:41 -0600
- Subject: RedBoot: ip_address crash
- Organization: MLB Associates
If there were no networks found, the 'ip_address' command fails
ungracefully. This bails out early if so.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.244
diff -u -5 -p -r1.244 ChangeLog
--- redboot/current/ChangeLog 23 May 2006 11:56:45 -0000 1.244
+++ redboot/current/ChangeLog 24 May 2006 12:23:49 -0000
@@ -1,5 +1,9 @@
+2006-05-24 Gary Thomas <gary@mlbassoc.com>
+
+ * src/net/net_io.c (do_ip_addr): Bail out if no networking.
+
2006-05-23 Gary Thomas <gary@mlbassoc.com>
* src/flash.c (fis_update_directory): Fix problems building on systems
with no FLASH locking.
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.44
diff -u -5 -p -r1.44 net_io.c
--- redboot/current/src/net/net_io.c 7 Apr 2006 23:00:00 -0000 1.44
+++ redboot/current/src/net/net_io.c 24 May 2006 12:23:52 -0000
@@ -836,10 +836,15 @@ do_ip_addr(int argc, char *argv[])
#ifdef CYGPKG_REDBOOT_NETWORKING_DNS
char *dns_addr;
bool dns_addr_set;
#endif
int num_opts;
+
+ if (!have_net) {
+ diag_printf("Sorry, networking is not available.\n");
+ return;
+ }
init_opts(&opts[0], 'l', true, OPTION_ARG_TYPE_STR,
(void *)&ip_addr, (bool *)&ip_addr_set, "local IP address");
init_opts(&opts[1], 'h', true, OPTION_ARG_TYPE_STR,
(void *)&host_addr, (bool *)&host_addr_set, "default server address");