--XuV1QlJbYrcVoo+x
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Jason DiCioccio (geniusj / bluenugget.net) wrote:

> Under FreeBSD 5.0-RELEASE running ruby 1.6.8, the following code:
>=20
> ----
> require 'socket'
>=20
> server =3D TCPServer.new(9999)
> client =3D server.accept
> ----
>=20
> only seems to bind to port 9999 on ipv6 interfaces.
>=20
> % netstat -an | grep 9999
> tcp6       0      0  *.9999                 *.*                    LISTEN
> %
>=20
> It works, however, when I specify a host to bind to.  It only fails when=
=20
> trying to use INADDR_ANY..
>=20
> I cannot tell for sure whether this is due to changes in FreeBSD, ruby, o=
r=20
> a combination of both.  However, my guess would be ruby since I have many=
=20
> daemons binding to INADDR_ANY and running fine.  Is anyone else running B=
SD=20
> (or perhaps other OS') with IPv6 support still in the kernel able to=20
> duplicate this problem?

You no doubt have sysctl net.inet6.ip6.v6only =3D 1

BEWARE THE SECURITY CONSEQUENCES OF CHANGING THIS TO 0

By changing it to '0', you will be able to listen on both tcp4 and tcp6

--=20
Eric Hodel - drbrain / segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04


--XuV1QlJbYrcVoo+x
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iD8DBQE+L5J8MypVHHlsnwQRAlEzAKCavxecKm/1NituOyjCifLVpeJ3FgCfb8Fm
63mzwHHv0CZ9rr4jmE6ERDI=
=tlAm
-----END PGP SIGNATURE-----

--XuV1QlJbYrcVoo+x--