On Sun, Jun 03, 2007 at 07:29:13PM +0200, Andrew Lunn wrote:
> Im away from home at the moment, so don't have any hardware to test
> with. I know this code compiles in different configurations, but
> please could you test it.

net_io.c didn't compile, two #endif and a brace were missing.
The opts array had to be extended, too, and I updated the usage string.


-- 
%SYSTEM-F-ANARCHISM, The operating system has been overthrown
Index: redboot/current/src/net/net_io.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/net/net_io.c,v
retrieving revision 1.47
diff -u -r1.47 net_io.c
--- redboot/current/src/net/net_io.c    19 Dec 2006 03:11:41 -0000      1.47
+++ redboot/current/src/net/net_io.c    4 Jun 2007 12:39:33 -0000
@@ -817,7 +817,10 @@
 
 static char usage[] = "[-b] [-l <local_ip_address>[/<mask_len>]] [-h 
<server_address>]"
 #ifdef CYGPKG_REDBOOT_NETWORKING_DNS
-       " [-d <dns_server_address]"
+       " [-d <dns_server_address>]"
+#ifdef CYGPKG_REDBOOT_NETWORKING_DNS_FCONFIG_DOMAIN
+        " [-D <dns_domain_name>]"
+#endif
 #endif
         ;
 
@@ -832,7 +835,7 @@
 void 
 do_ip_addr(int argc, char *argv[])
 {
-    struct option_info opts[4];
+    struct option_info opts[5];
     char *ip_addr, *host_addr;
     bool ip_addr_set, host_addr_set;
     bool do_bootp = false;
@@ -840,6 +843,10 @@
 #ifdef CYGPKG_REDBOOT_NETWORKING_DNS
     char *dns_addr;
     bool dns_addr_set;
+#ifdef CYGPKG_REDBOOT_NETWORKING_DNS_FCONFIG_DOMAIN 
+    char *dns_domain;
+    bool dns_domain_set;
+#endif
 #endif
     int num_opts;
  
@@ -859,8 +866,12 @@
     init_opts(&opts[num_opts], 'd', true, OPTION_ARG_TYPE_STR, 
               (void *)&dns_addr, (bool *)&dns_addr_set, "DNS server address");
     num_opts++;
+#ifdef CYGPKG_REDBOOT_NETWORKING_DNS_FCONFIG_DOMAIN 
+    init_opts(&opts[num_opts], 'D', true, OPTION_ARG_TYPE_STR, 
+              (void *)&dns_domain, (bool *)&dns_domain_set, "DNS domain");
+    num_opts++;
+#endif
 #endif
-
     CYG_ASSERT(num_opts <= NUM_ELEMS(opts), "Too many options");
 
     if (!scan_opts(argc, argv, 1, opts, num_opts, 0, 0, "")) {
@@ -907,6 +918,11 @@
     if (dns_addr_set) {
         set_dns(dns_addr);
     }
+#ifdef CYGPKG_REDBOOT_NETWORKING_DNS_FCONFIG_DOMAIN 
+    if (dns_domain_set) {
+        setdomainname(dns_domain, strlen(dns_domain));
+    }
+#endif
 #endif
     show_addrs();
     if (!have_net) {

Reply via email to