[Win32utils-devel] ICMP pings on 1.9
phasis at gmail.com
Sun Feb 26 09:32:51 UTC 2012
2012/2/26 Daniel Berger <djberg96 at gmail.com>
> While making some tweaks to the net-ping library, I noticed that I started
> getting test failures with 1.9.x on Vista for ICMP pings. A simple program
> should demonstrate:
> require 'net/ping'
> npi = Net::Ping::ICMP.new('localhost')
> p npi.ping?
> icmp.rb:109:in `send': An address incompatible with the requested protocol
> was used. - send(2) (Errno::EAFNOSUPPORT)
> from icmp.rb:109:in `ping'
> from icmp.rb:184:in `<main>'
> Where line 109 (using the latest git repo) is:
> socket.send(msg, 0, saddr)
> I don't see this failure using 1.8, or even 1.9 on Unix platforms. Any
On Windows Vista (and Windows 7), the host "localhost" translated into
"::1" IPv6 Loopback address instead of "127.0.0.1" IPv4 Loopback address.
You can check it with "ping localhost" in command prompt.
You must use "127.0.0.1" instead of "localhost" for this test case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the win32utils-devel