From 11e49671fdfd7b0bfab50935fe7b4556cea972bf Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 10 Apr 2018 21:22:06 +0100 Subject: [PATCH] #388 searching for 0.x.x.x returns Internal Server Error (C. Neuhaus) --- lib/App/Netdisco/Web/Plugin/Search/Node.pm | 1 + lib/App/Netdisco/Web/Search.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/App/Netdisco/Web/Plugin/Search/Node.pm b/lib/App/Netdisco/Web/Plugin/Search/Node.pm index f369ad99..45394e2c 100644 --- a/lib/App/Netdisco/Web/Plugin/Search/Node.pm +++ b/lib/App/Netdisco/Web/Plugin/Search/Node.pm @@ -23,6 +23,7 @@ ajax '/ajax/content/search/node' => require_login sub { my ( $start, $end ) = param('daterange') =~ m/(\d+-\d+-\d+)/gmx; my $mac = NetAddr::MAC->new(mac => $node); + undef $mac if ($mac and $mac->as_ieee and ($mac->as_ieee eq '00:00:00:00')); my @active = (param('archived') ? () : (-bool => 'active')); my (@times, @wifitimes, @porttimes); diff --git a/lib/App/Netdisco/Web/Search.pm b/lib/App/Netdisco/Web/Search.pm index c1684f64..2d2cb01d 100644 --- a/lib/App/Netdisco/Web/Search.pm +++ b/lib/App/Netdisco/Web/Search.pm @@ -39,6 +39,7 @@ get '/search' => require_login sub { my $nd = $s->resultset('Device')->search_fuzzy($q); my ($likeval, $likeclause) = sql_match($q); my $mac = NetAddr::MAC->new($q); + undef $mac if ($mac and $mac->as_ieee and ($mac->as_ieee eq '00:00:00:00')); if ($nd and $nd->count) { if ($nd->count == 1) {