diff --git a/Netdisco/Changes b/Netdisco/Changes index 0d6a785b..56204e7b 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -12,6 +12,10 @@ * Use Path::Class for path and file name construction consistently * Avoid use of DNS when looking up devices in DB by IP + [BIG FIXES] + + * Search by device port MAC no longer fatal + 2.005000_002 - 2013-02-10 [ENHANCEMENTS] diff --git a/Netdisco/lib/App/Netdisco/DB/ResultSet/Device.pm b/Netdisco/lib/App/Netdisco/DB/ResultSet/Device.pm index 8841f172..f5e6f0f8 100644 --- a/Netdisco/lib/App/Netdisco/DB/ResultSet/Device.pm +++ b/Netdisco/lib/App/Netdisco/DB/ResultSet/Device.pm @@ -70,7 +70,8 @@ sub search_aliases { my $clause; if ($by_ip) { - my $ip = NetAddr::IP::Lite->new($q); + my $ip = NetAddr::IP::Lite->new($q) + or return undef; # could be a MAC address! $clause = [ 'me.ip' => { '<<=' => $ip->cidr }, 'device_ips.alias' => { '<<=' => $ip->cidr },