From 1e90fea47a2a6bb522458c9dcf4ed2839025ceb7 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 3 Sep 2014 12:57:15 +0000 Subject: [PATCH] do not attempt DNS resolution on bad IPs --- Netdisco/Changes | 1 + Netdisco/lib/App/Netdisco/Util/DNS.pm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 5102f44f..708aa33b 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -8,6 +8,7 @@ [BUG FIXES] * Skip device aliases which cannot be parsed as IPs + * [#137] do not attempt DNS resolution on bad IPs 2.029006 - 2014-08-25 diff --git a/Netdisco/lib/App/Netdisco/Util/DNS.pm b/Netdisco/lib/App/Netdisco/Util/DNS.pm index d55b2e42..914024eb 100644 --- a/Netdisco/lib/App/Netdisco/Util/DNS.pm +++ b/Netdisco/lib/App/Netdisco/Util/DNS.pm @@ -166,7 +166,8 @@ sub no_resolve { my $config = setting('dns')->{no} || []; return 0 if not scalar @$config; - my $addr = NetAddr::IP::Lite->new($ip); + my $addr = NetAddr::IP::Lite->new($ip) + or return 1; foreach my $item (@$config) { my $c_ip = NetAddr::IP::Lite->new($item)