This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Inconsistency between the Open BSD IP stack and the tests in version 2.0
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Paul Riley <PRILEY at altera dot com>
- Cc: Andrew Lunn <andrew at lunn dot ch>, ecos-discuss at sources dot redhat dot com
- Date: Tue, 17 Aug 2004 18:55:58 +0200
- Subject: Re: [ECOS] Inconsistency between the Open BSD IP stack and the tests in version 2.0
- References: <45E39EE2E44FD443AEFAC07728BF3B50CACFB6@uk-ismsg02.altera.priv.altera.com>
On Tue, Aug 17, 2004 at 05:51:17PM +0100, Paul Riley wrote:
> FreeBSD, I'm trying to get all the regression tests on our architecture,
> but the problem is in both.
You are realy sure it happens with the OpenBSD stack?
Anyway, here is a totally untested patch for the FreeBSD stack. Please
let me know if it works.
Andrew
Index: net/bsd_tcpip/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.48
diff -u -r1.48 ChangeLog
--- net/bsd_tcpip/current/ChangeLog 16 Jul 2004 10:43:28 -0000 1.48
+++ net/bsd_tcpip/current/ChangeLog 17 Aug 2004 16:55:24 -0000
@@ -1,3 +1,9 @@
+2004-08-17 Andrew Lunn <andrew.lunn@ascom.ch>
+
+ * src/sys/kern/sockio.c (bsd_bind): Pass a copy of the sa into
+ bind so that the "kernel" code does not modify the "user" codes
+ version of the socket address.
+
2004-07-15 Oyvind Harboe <oyvind.harboe@zylin.com>
*cdl/freebsd_net.cdl:
Index: net/bsd_tcpip/current/src/sys/kern/sockio.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/kern/sockio.c,v
retrieving revision 1.5
diff -u -r1.5 sockio.c
--- net/bsd_tcpip/current/src/sys/kern/sockio.c 17 Jan 2004 14:10:52 -0000 1.5
+++ net/bsd_tcpip/current/src/sys/kern/sockio.c 17 Aug 2004 16:55:25 -0000
@@ -246,8 +246,9 @@
bsd_bind(cyg_file *fp, const sockaddr *sa, socklen_t len)
{
int error;
-
- error = sobind((struct socket *)fp->f_data, (sockaddr *)sa, 0);
+ sockaddr sa1=*sa;
+
+ error = sobind((struct socket *)fp->f_data, (sockaddr *)&sa1, 0);
return error;
}
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss