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: RedBoot FIS and BOOTP Patches


On Tue, 2002-10-22 at 17:44, Jay Foster wrote:
> Enclosed are two proposed patches for RedBoot.  The first one is a
> copy/paste error for the display of the fis delete command.  The second one
> fixes a bug in bootp that was sending out short bootp request packets, which
> would be ignored by the bootp server.
> 

Committed - slightly reworked (see below).  Next time, please include
a ChangeLog entry (so I don't have to make one up).

Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.81
diff -u -5 -p -r1.81 ChangeLog
--- redboot/current/ChangeLog	16 Sep 2002 13:18:40 -0000	1.81
+++ redboot/current/ChangeLog	24 Oct 2002 18:28:14 -0000
@@ -1,5 +1,14 @@
+2002-10-24  Gary Thomas  <gthomas@ecoscentric.com> (inspired by)
+2002-10-24  Jay Foster <jay@systech.com>	
+
+	* include/net/bootp.h (BP_MIN_VEND_SIZE): 
+	* src/net/bootp.c (__bootp_find_local_ip): Require a minimum vendor
+	area to always be sent (to keep some servers happy).
+
+	* src/flash.c: Fix typo for "FIS DELETE"
+
 2002-09-16  Mark Salter  <msalter@redhat.com>
 
 	* src/main.c (set_console_baud_rate): Handle CYGPKG_REDBOOT_ANY_CONSOLE.
 	(set_comm_baud_rate): New function.
 
Index: redboot/current/include/net/bootp.h
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/include/net/bootp.h,v
retrieving revision 1.4
diff -u -5 -p -r1.4 bootp.h
--- redboot/current/include/net/bootp.h	9 Jul 2002 20:23:48 -0000	1.4
+++ redboot/current/include/net/bootp.h	24 Oct 2002 18:26:02 -0000
@@ -89,10 +89,11 @@ SOFTWARE.
 #define BP_CHADDR_LEN	 16
 #define BP_SNAME_LEN	 64
 #define BP_FILE_LEN	128
 #define BP_VEND_LEN	312
 #define BP_MINPKTSZ	300	/* to check sizeof(struct bootp) */
+#define BP_MIN_VEND_SIZE 64     /* minimum actual vendor area */
 
 typedef struct bootp {
     unsigned char    bp_op;			/* packet opcode type */
     unsigned char    bp_htype;			/* hardware addr type */
     unsigned char    bp_hlen;			/* hardware addr length */
Index: redboot/current/src/flash.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/flash.c,v
retrieving revision 1.41
diff -u -5 -p -r1.41 flash.c
--- redboot/current/src/flash.c	27 Aug 2002 11:06:48 -0000	1.41
+++ redboot/current/src/flash.c	24 Oct 2002 18:26:00 -0000
@@ -105,11 +105,11 @@ local_cmd_entry("free",
                 "",
                 fis_free,
                 FIS_cmds
     );
 local_cmd_entry("delete",
-                "Display an image from FLASH Image System [FIS]",
+                "Delete an image from FLASH Image System [FIS]",
                 "name",
                 fis_delete,
                 FIS_cmds
     );
 
Index: redboot/current/src/net/bootp.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/bootp.c,v
retrieving revision 1.8
diff -u -5 -p -r1.8 bootp.c
--- redboot/current/src/net/bootp.c	9 Jul 2002 20:23:48 -0000	1.8
+++ redboot/current/src/net/bootp.c	24 Oct 2002 18:26:01 -0000
@@ -170,10 +170,12 @@ __bootp_find_local_ip(bootp_header_t *in
      
     AddOption(p,dhcpCookie);
     AddOption(p,dhcpRequestOption);
     AddOption(p,dhcpEndOption);
 
+    // Some servers insist on a minimum amount of "vendor" data
+    if (p < &b.bp_vend[BP_MIN_VEND_SIZE]) p = &b.bp_vend[BP_MIN_VEND_SIZE];
     txSize = p - (unsigned char*)&b;
 #else
     txSize = sizeof(b);
 #endif
 

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


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