#274 errors in IP Inventory report

This commit is contained in:
Oliver Gorwits
2018-03-10 11:32:02 +00:00
parent a2269c469f
commit 9fa8372685
3 changed files with 10 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ get '/ajax/content/report/ipinventory' => require_login sub {
# Default to something simple with no results to prevent
# "Search failed!" error
my $subnet = param('subnet') || '0.0.0.0/32';
(my $subnet = (param('subnet') || '0.0.0.0/32')) =~ s/\s//g;
$subnet = NetAddr::IP::Lite->new($subnet);
$subnet = NetAddr::IP::Lite->new('0.0.0.0/32')
if (! $subnet) or ($subnet->addr eq '0.0.0.0');
@@ -41,7 +41,7 @@ get '/ajax/content/report/ipinventory' => require_login sub {
{ join => 'device',
select => [
'alias AS ip',
\'NULL as mac',
\'NULL::macaddr as mac',
'creation AS time_first',
'device.last_discover AS time_last',
'dns',