-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 Support #45
Comments
Thanks for the awesome bug report. I'm surprised you need to specify the constant Granted, this has clearly never been tested, so thanks for the thorough review of the current situation. What solution do you think makes the most sense? Whatever solution we choose, clearly we should write some specs for it to ensure IPv6 support is well maintained. |
If we forgo using "DNS" hostnames it's as simple as 'ipaddr' ( included in stdlib ) can tell you what to use example ( require 'ipaddr'
host_address = IPAddr.new host
family = host_address.ipv6? ? Socket::AF_INET6 : Socket::AF_INET
socket = UDPSocket.new family |
Okay, so we could make a wrapper, e.g. def network_address(address)
if IPAddr === address
return address
else
return IPAddr.new(address)
end
end Then in the code for the socket use the code you proposed? |
Yup, looks good :) |
Okay just release 0.9.2 which fixes this issue. |
Hi,
I see that you have "excluded" IPv6 support. Which is really bad.
When I've used :: as bind host in your example,
it gave me this error :
Quick look at rubydns-0.9.1/lib/rubydns/handler.rb
shows @126
now changing line 127 to :
Gets it running like a charm :
with netstat confirming opening right sockets:
and dig confirming it works as expected :
with that little change you can have it correctly listening on IPv6 sockets, they are brilliant, because on most systems they also enable IPv4 listening :
same example script running, just query over legacy IPv4
So the only thing missing would be distinguishing between UDP sockets between IPv6 and IPv4 host, which is darn simple with a regex or IPAddr or even, pass it as an attribute so we can decide.
The text was updated successfully, but these errors were encountered: