From: Stephan Maka Date: 2006-04-24T04:24:49+09:00 Subject: resolv.rb and IPv6 nameservers --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello folks, UDPSocket requires address family given on initialization, so it's not possible to create an UDPSocket and *then* decide, to which hosts to send packets to. That's a problem for Ruby's resolver if you've got AF_INET6 nameservers in your /etc/resolv.conf. The following very dirty hack chooses AF_INET6 for UDPSocket, if the nameserver's address contains colons (:). --- /usr/local/lib/ruby/1.8/resolv.rb Mon Feb 7 16:24:09 2005 +++ resolv2.rb Sun Apr 23 20:53:17 2006 @@ -621,7 +621,7 @@ super() @host = host @port = port - @sock = UDPSocket.new + @sock = UDPSocket.new(host.index(':') ? Socket::AF_INET6 : Socket::AF_INET) @sock.connect(host, port) @sock.fcntl(Fcntl::F_SETFD, 1) if defined? Fcntl::F_SETFD @id = -1 Any suggestions? Stephan. --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFES9SGuKMfCHUX8x0RAv6aAJ4kot9jjliuozNta07AcRESJOxc7QCgns63 fauVbHRWtnlLF5I6pBTHGUE= =d6Rt -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf--