#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

@@ -12,7 +12,7 @@ __PACKAGE__->table('cidr_ips');
__PACKAGE__->result_source_instance->is_virtual(1);
__PACKAGE__->result_source_instance->view_definition(<<'ENDSQL');
SELECT host(network (prefix) + sub.int)::inet AS ip,
NULL AS mac,
NULL::macaddr AS mac,
NULL::text AS dns,
NULL::timestamp AS time_first,
NULL::timestamp AS time_last,

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',