Patch/Bugfix for BOOTP in rtems-ss-20020205

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Tue Mar 19 10:54:29 UTC 2002


Hi,

yesterday I tested the BOOTP client functionality on a MC68360 
board (with ROM at address 0) and I found, that bootpc_init 
crashes due to a write to address 0.

It seems that the variable "dhcp_hostname" has been converted 
from a character array to a character pointer, but is still 
filled with a "memset" to initialize it to be invalid. 

Attached is a patch to fix it. Any comments?

wkr,
	Thomas Doerfler.
--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_key.htm


-------------- next part --------------
--- rtems-ss-20020205/c/src/libnetworking/nfs/bootp_subr.c	Wed Sep 19 19:30:38 2001
+++ /usr/local/projects/sandbox/zem40/rtems_patch/bootp_subr.c	Mon Mar 18 21:34:08 2002
@@ -902,12 +902,16 @@
     if (rtems_create_root_fs () < 0) {
       printf("Error creating the root filesystem.\nFile not created.\n");
       update_files = 0;
     }
 
-  memset(dhcp_hostname, 0, sizeof(dhcp_hostname));
-  
+#if 0
+  memset(dhcp_hostname, 0, sizeof(dhcp_hostname)); 
+#else
+  dhcp_hostname = NULL;
+#endif
+
   /*
    * Find a network interface.
    */
   for (ifp = ifnet; ifp != 0; ifp = ifp->if_next)
     if ((ifp->if_flags &


More information about the users mailing list