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: [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message