Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2002 02:10:18 +0900
From:      JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= <jinmei@isl.rdc.toshiba.co.jp>
To:        "June Carey" <carey_june@hotmail.com>
Cc:        net@FreeBSD.ORG, bugs@FreeBSD.ORG
Subject:   Re: FreeBSD-4.3 IPv6 bug - Further information.
Message-ID:  <y7v8zb7tpqd.wl@condor.jinmei.org>
In-Reply-To: <F1809q58xl8A6P1RY1i0001a740@hotmail.com>
References:  <F1809q58xl8A6P1RY1i0001a740@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> On Tue, 08 Jan 2002 17:57:00 +0000, 
>>>>> "June Carey" <carey_june@hotmail.com> said:

> END OF CLIENT/SERVER CONNECTION RESULTS
> =======================================

> 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.

Well, unfortunately, this behavior is not a bug.  An AF_INET6 socket
can accept an IPv4 connection with IPv4-mapped IPv6 addresses, as
specified in draft-ietf-ipngwg-rfc2553bis-04.txt.  In this case, of
course, the sa_family field is AF_INET6, and the sa_len field is
sizeof(sockaddr_in6).

FreeBSD 4.4-RELEASE has a partial support to disable this feature by
the IPV6_V6ONLY option, which, as far as I know, is not included in
FreeBSD 4.3.  If you do not want to accept an IPv4 connection on an
AF_INET6 socket, I'd recommend you to migrate to FreeBSD 4.4 and
rewrite the application with the option.

By the way, detail behaviors about IPv4-mapped IPv6 addresses are very
different among various OSes, so you should be careful if you want to
make your applications portable on other OSes.  You may also want to
check at the following web page to see the differences:
http://www.kame.net/newsletter/20010504/

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					jinmei@isl.rdc.toshiba.co.jp

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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