# Pastebin ZkoK4G3k diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index 3fefbd7..f57859e 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -26,15 +26,7 @@ function discover_new_device($hostname, $device='', $method='', $interface='') { d_echo("discovering $dst_host\n"); $ip = gethostbyname($dst_host); - if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false) { - // $ip isn't a valid IP so it must be a name. - if ($ip == $dst_host) { - d_echo("name lookup of $dst_host failed\n"); - - return false; - } - } - else { + if (filter_var($dst_host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === true || filter_var($dst_host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === true) { if ($config['discovery_by_ip'] === false) { d_echo('Discovery by IP disabled, skipping ' . $dst_host); return false;