Search by device port MAC no longer fatal

This commit is contained in:
Oliver Gorwits
2013-03-02 15:56:13 +00:00
parent 26c5014479
commit 5d33591903
2 changed files with 6 additions and 1 deletions

View File

@@ -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]

View File

@@ -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 },