changeset 2212:990ca86dc9d4

Don't try 'ip_address' command if no networking - avoids crash
author gthomas
date Wed, 24 May 2006 12:24:46 +0000
parents acfe2ec52590
children aacaba4e9e6d
files packages/redboot/current/ChangeLog packages/redboot/current/src/net/net_io.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -1,3 +1,7 @@
+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
--- a/packages/redboot/current/src/net/net_io.c
+++ b/packages/redboot/current/src/net/net_io.c
@@ -838,6 +838,11 @@ do_ip_addr(int argc, char *argv[])
     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");