From owner-freebsd-bugs Wed Jan 9 1:41:20 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from patan.sun.com (patan.Sun.COM [192.18.98.43]) by hub.freebsd.org (Postfix) with ESMTP id C4D2A37B420; Wed, 9 Jan 2002 01:41:13 -0800 (PST) Received: from sunchorus.France.Sun.COM ([129.157.173.1]) by patan.sun.com (8.9.3+Sun/8.9.3) with ESMTP id CAA20187; Wed, 9 Jan 2002 02:40:53 -0700 (MST) Received: from dvorak (dvorak [129.157.196.32]) by sunchorus.France.Sun.COM (8.8.8+Sun/8.8.8/ENSMAIL,v2.1) with SMTP id KAA03750; Wed, 9 Jan 2002 10:41:10 +0100 (MET) Message-Id: <200201090941.KAA03750@sunchorus.France.Sun.COM> Date: Wed, 9 Jan 2002 10:41:10 +0100 (MET) From: Stephane Carrez Reply-To: Stephane Carrez Subject: Re: FreeBSD-4.3 IPv6 bug - Further information. To: kris@obsecurity.org, carey_june@hotmail.com Cc: net@FreeBSD.ORG, bugs@FreeBSD.ORG MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: 8yJVGyhjDQFh08tZi608lA== X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.4 SunOS 5.8 sun4u sparc Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi! June Carey wrote: >The "bug" is that netstat(1) shows a tcp4 connection between the Server and >the Client, but accept(2) is filling out the address structure with a >sin_family of 28, when it should be 2 (AF_INET). > >The other "bug" I've recently discovered, and which is demonstrated above, >is that when you've got a tcp4 connection between the Client and the Server, >"addrLen" is 28, when it should be 16. > I don't think this is a bug. Assuming that the server accepting socket is AF_INET6, you should do the following on the socket: int on; on = 1; setsockopt(fd, IPPROTO_IPV6, IPV6_BINDV6ONLY, &on, sizeof(on)); Otherwise, the inpcb is marked with INP_IPV4 which means the IPv4 packet can be received by the socket. The address is then mapped to IPv6 because the socket is AF_INET6. Cheers, Stephane - - - - - - - - - - Stephane |Sun Microsystems | Carrez |Network Service Provider Division | http://www.sun.com |6 avenue Gustave Eiffel | |F-78182, St-Quentin-en-Yvelines-Cedex | email: Stephane.Carrez@France.Sun.COM To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message