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]

Re: A small patch to avoid error compiling without DHCP clientsupport


On Mon, 2003-10-06 at 16:21, Niklaus Giger wrote:
> --- packages/redboot/current/src/net/net_io.c   19 Sep 2003 17:11:34 -0000      
> 1.35
> +++ packages/redboot/current/src/net/net_io.c   6 Oct 2003 22:20:27 -0000
> @@ -836,7 +836,9 @@
>                  return;
>              }
>              mask = htonl((0xffffffff << (32-mask_len))&0xffffffff);
> +#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
>              memcpy(&__local_ip_mask, &mask, 4);
> +#endif
>          }
> 
>          if (!_gethostbyname(ip_addr, (in_addr_t *)&host)) {

Actually, DHCP and GATEWAY support are now separated, but nonetheless
there were problems if GATEWAY was disabled.  The attached patch fixes
them.

Thanks for pointing this out.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.146
diff -u -5 -p -r1.146 ChangeLog
--- redboot/current/ChangeLog	6 Oct 2003 15:42:05 -0000	1.146
+++ redboot/current/ChangeLog	6 Oct 2003 22:35:12 -0000
@@ -1,7 +1,10 @@
 2003-10-06  Gary Thomas  <gary@mlbassoc.com>
 
+	* src/net/net_io.c: 
+	* src/net/bootp.c: Fix some compile problems if GATEWAY support is disabled.
+
 	* src/flash.c (fis_list): Display FIS directory entries in FLASH
 	address (sorted) order.
 
 2003-10-03  Gary Thomas  <gary@mlbassoc.com>
 
Index: redboot/current/src/net/bootp.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/bootp.c,v
retrieving revision 1.18
diff -u -5 -p -r1.18 bootp.c
--- redboot/current/src/net/bootp.c	26 Sep 2003 10:35:44 -0000	1.18
+++ redboot/current/src/net/bootp.c	6 Oct 2003 22:34:17 -0000
@@ -278,14 +278,14 @@ __bootp_find_local_ip(bootp_header_t *in
                             optlen = 1;
                         else {
                             optlen = p[1];
                             p += 2;
                             switch (tag) {
+#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
                             case TAG_SUBNET_MASK:  // subnet mask
                                 memcpy(__local_ip_mask,p,4); 
                                 break;
-#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
                             case TAG_GATEWAY:  // router
                                 memcpy(__local_ip_gate,p,4); 
                                 break;
 #endif
                             default:
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.35
diff -u -5 -p -r1.35 net_io.c
--- redboot/current/src/net/net_io.c	19 Sep 2003 17:11:34 -0000	1.35
+++ redboot/current/src/net/net_io.c	6 Oct 2003 22:34:19 -0000
@@ -821,10 +821,11 @@ do_ip_addr(int argc, char *argv[])
 #endif
     if (!scan_opts(argc, argv, 1, opts, num_opts, 0, 0, "")) {
         return;
     }
     if (ip_addr_set) {
+#ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
         char *slash_pos;
         /* see if the (optional) mask length was given */
         if( (slash_pos = strchr(ip_addr, '/')) ) {
             int mask_len;
             unsigned long mask;
@@ -836,11 +837,11 @@ do_ip_addr(int argc, char *argv[])
                 return;
             }
             mask = htonl((0xffffffff << (32-mask_len))&0xffffffff);
             memcpy(&__local_ip_mask, &mask, 4);
         }
-        
+#endif        
         if (!_gethostbyname(ip_addr, (in_addr_t *)&host)) {
             diag_printf("Invalid local IP address: %s\n", ip_addr);
             return;
         }
         // Of course, each address goes in its own place :-)

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