This is the mail archive of the ecos-discuss@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]

RE: BOOTP - default route



On 11-Sep-2000 Joerg Troeger wrote:
> The default route is not set correctly in bootp_support.c
> 
> Solution: initialize addrp->sin_len before line #466 (copy from line #427).
> It was overwritten in line #453.
> 
> Jörg
> 

Thanks for pointing this out.  I'll apply this patch:

Index: net/tcpip/current/ChangeLog
===================================================================
RCS file: /local/cvsfiles/ecc/ecc/net/tcpip/current/ChangeLog,v
retrieving revision 1.91
diff -u -5 -p -r1.91 ChangeLog
--- net/tcpip/current/ChangeLog 2000/09/08 20:40:25     1.91
+++ net/tcpip/current/ChangeLog 2000/09/11 13:51:32
@@ -1,5 +1,9 @@
+2000-09-11  Joerg Troeger <jtroeger@nortelnetworks.com>
+
+       * src/lib/bootp_support.c (init_net): Set default route correctly.
+
 2000-09-01  Hugo Tyson  <hmt@cygnus.co.uk>
 
        * src/ecos/support.c (cyg_net_init): You can't print things while
        initializing the network!  Well, not if connected to GDB over the
        network anyway.  The printf("Init device '%s'...); removed.
Index: net/tcpip/current/src/lib/bootp_support.c
===================================================================
RCS file: /local/cvsfiles/ecc/ecc/net/tcpip/current/src/lib/bootp_support.c,v
retrieving revision 1.13
diff -u -5 -p -r1.13 bootp_support.c
--- net/tcpip/current/src/lib/bootp_support.c   2000/07/27 14:02:41     1.13
+++ net/tcpip/current/src/lib/bootp_support.c   2000/09/11 13:51:34
@@ -461,10 +461,11 @@ init_net(const char *intf, struct bootp 
         // ...and it's a nonzero address...
         if ( 0 != gateway.s_addr ) {
             memset(&route, 0, sizeof(route));
             addrp->sin_family = AF_INET;
             addrp->sin_port = 0;
+            addrp->sin_len = sizeof(*addrp);
             addrp->sin_addr.s_addr = 0; // Use 0,0,GATEWAY for the default route
             memcpy(&route.rt_dst, addrp, sizeof(*addrp));
             addrp->sin_addr.s_addr = 0;
             memcpy(&route.rt_genmask, addrp, sizeof(*addrp));
             addrp->sin_addr = gateway;


Of course, if you don't want your name in the ChangeLog, I can put my own
since it's such a small change, but we always like to give proper credit.



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