This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: BOOTP - default route
- To: Joerg Troeger <jtroeger at nortelnetworks dot com>
- Subject: RE: [ECOS] BOOTP - default route
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Mon, 11 Sep 2000 07:53:45 -0600 (MDT)
- Cc: ecos-discuss <ecos-discuss at sources dot redhat dot com>
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.