Subject: Re: accepting both ipv4 and v6 connections
To: <>
From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
List: tech-net
Date: 05/12/2004 17:11:41
--2/5bycvrmDh4d1IB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 12, 2004 at 08:06:07AM -0700, Jeff Rizzo wrote:
> Really bad form to have posted a question that I can now
> answer myself, but I figured the archives deserve an answer.  :)
>=20
> >From what I gather, ipv4-mapped addresses are now disabled by
> default in NetBSD, for security reasons.  (I'm still a little vague
> on what those security reasons are, but they come from folks I trust
> to know what they're talking about)  The old behaviour can
> be reenabled by setting net.inet6.ip6.v6only to 0 with sysctl.
>=20
> Just as a followup question, is the "correct" way to support both
> ipv4 and ipv6 in a case like this to loop over the return
> from getaddrinfo() and bind a listening fd to both :: and 0.0.0.0 ?
> That is, always handle all protocols explicitly?

That's the protocol-independent version.

The other one only handles IPv4 and IPv6, and will fail in other situations
where getaddrinfo might find more than one address per AF.

Regards,
	-is

--2/5bycvrmDh4d1IB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQEVAgUBQKI+pDCn4om+4LhpAQFGlAf/Wk8Op60nxj95dIoIKZWKwgcdhlhvXbwj
QZk1r1ZfhF2yEkBVO5TYgk+g/HatH4U110wAQyeSKSIsGnLK12BG/HNHeVxqmBNe
MBv0lpsNk4Qk8usPtuZY8GVGBj1NO07MDjEXcczqzBYbFTspnM00yD+btrKZDT60
vKBCmuZOkCaLXhO9EVCxfhl2589DMlydP7eItNDEQ+POXje4UF3dzfftagv9K/vR
OmELM3LN+iRVaU29OEYXIFiDDfvYIbC5zRZs6hp2Dc0i+CIQldDG+l92fGkyO8FX
AxSk6sBaNoWNkqihtE4uHtGN0FDmKpDpEyixM0KBdoNf4REVUMftdA==
=C+4p
-----END PGP SIGNATURE-----

--2/5bycvrmDh4d1IB--