Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jan 2002 17:57:00 +0000
From:      "June Carey" <carey_june@hotmail.com>
To:        kris@obsecurity.org
Cc:        net@freebsd.org, bugs@freebsd.org
Subject:   FreeBSD-4.3 IPv6 bug - Further information.
Message-ID:  <F1809q58xl8A6P1RY1i0001a740@hotmail.com>

next in thread | raw e-mail | index | archive | help
>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




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