Project

General

Profile

« Previous | Next » 

Revision a3783af8

Added by Zak Herner over 9 years ago

Fixes #8788 - DHCP not detecting pingable addresses on Windows

View differences:

modules/dhcp/subnet.rb
def icmp_pingable? ip
# Always shell to ping, instead of using net-ping
if PLATFORM =~ /mingw/
# Windows uses different options for ping and does not have /dev/null
system("ping -n 1 -w 1 #{ip} > NUL")
else
# Default to Linux ping options and send to /dev/null
system("ping -c 1 -W 1 #{ip} > /dev/null")
end
rescue
# We failed to check this address so we should not use it
true

Also available in: Unified diff