"David F. Skoll" <d...@roaringpenguin.com> writes:

> On Tue, 25 Sep 2012 14:02:14 -0700 (PDT)
> "Dan Mahoney, System Admin" <d...@prime.gushi.org> wrote:
>
>> This means that if you want to listen on v6, none of your v4 clients
>> can connect.
>
> I think this is a FreeBSDism.  On Linux, something listening on
> :: will answer both IPv4 and IPv6 connection attempts.
>
> Maybe FreeBSD has a way to emulate that?

It's not quite right to call that a FreeBSDism; it's much messier than
that.

IPv6 supports a concept called mapped addresses, where v4 addresses can
be represented in v6 addresses.   A system can be configured to have
sockets that listen on :: also listen on INADDR_ANY and present the v4
addresses as mapped v6 addresses.

This feature is somewhat controversial, because of security concerns (if
the program didn't open a v4 socket, why is it possible to connect to it
over the net via v4?):

http://en.wikipedia.org/wiki/IPv4_mapped_address#IPv4-mapped_IPv6_addresses

On NetBSD, the default is that v6 sockets are only v6 (via sysctl):
"net.inet6.ip6.v6only = 1", and I believe OpenBSD and FreeBSD are the
same way.

See 
  http://tools.ietf.org/html/rfc3493
  http://tools.ietf.org/html/rfc3542#section-13

So I suspect that on Linux, v6only defaults to off (while on *BSD it
defaults to on).  Apparently on some systems it's always off because the
stacks are separate

IMHO, portable software should have two sockets, one on INADDR_ANY and
one on IN6ADDR_ANY.  But, setting the socket option may be a workaround.
It's certainly wrong to assume that an OS has a particular default.

Attachment: pgpc7gCvVHuns.pgp
Description: PGP signature

Reply via email to