From owner-freebsd-net Tue Jan 8 9:57:11 2002 Delivered-To: freebsd-net@freebsd.org Received: from hotmail.com (f180.law11.hotmail.com [64.4.17.180]) by hub.freebsd.org (Postfix) with ESMTP id 2088B37B427; Tue, 8 Jan 2002 09:57:00 -0800 (PST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 8 Jan 2002 09:57:00 -0800 Received: from 212.159.185.206 by lw11fd.law11.hotmail.msn.com with HTTP; Tue, 08 Jan 2002 17:57:00 GMT X-Originating-IP: [212.159.185.206] From: "June Carey" To: kris@obsecurity.org Cc: net@freebsd.org, bugs@freebsd.org Subject: FreeBSD-4.3 IPv6 bug - Further information. Date: Tue, 08 Jan 2002 17:57:00 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 08 Jan 2002 17:57:00.0643 (UTC) FILETIME=[DF305B30:01C1986D] Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >So far you haven't given enough information to diagnose the problem. Actually, I rather think I have given enough information ! :) Here's the full details anyway: System: FreeBSD-4.3/i386 Source code: C++ compiled with stock g++ compiler. Correctly assume that I know how to write Server and Client network software, and that I've been doing it for years. The normal accept(2) call in the context of a listening Server is like this: accept (portDescriptor, &addr, &addrLen) Where "addr" is a: union AP_ServerAddrType { struct sockaddr_in addr; struct sockaddr_in6 addr6; }; And "addrLen" is a: socklen_t addrLen; CLIENT/SERVER CONNECTION RESULTS: ================================= Decimal numbering: In Server IPv4 mode (listening socket sin_family=AF_INET) and a netstat(1) -a showing Proto=tcp4: addrLen=16, addr->addr.sin_family=2 In Server IPv6 mode (listening socket sin_family=AF_INET6) and a netstat(1) -a showing Proto=tcp4: addrLen=28, addr->addr.sin_family=28 In Server IPv6 mode (listening socket sin_family=AF_INET6) and a netstat(1) -a showing Proto=tcp6: addrLen=28, addr->addr.sin_family=28 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. Cheers, Robin Carey. > >Kris _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message