Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jan 2002 10:41:10 +0100 (MET)
From:      Stephane Carrez <Stephane.Carrez@Sun.COM>
To:        kris@obsecurity.org, carey_june@hotmail.com
Cc:        net@FreeBSD.ORG, bugs@FreeBSD.ORG
Subject:   Re: FreeBSD-4.3 IPv6 bug - Further information.
Message-ID:  <200201090941.KAA03750@sunchorus.France.Sun.COM>

next in thread | raw e-mail | index | archive | help

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-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201090941.KAA03750>