Only return distinct Port MAC's and skip '00:00:00:00:00:00' addresses in get_port_macs database query, to reduce the number of rows returned from the database to those we will be able to use
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* Require SNMP::Info 3.10+, use new c_cap method to tag device remote_type
|
||||
as 'IP Phone:' or 'AP:' when those capabilities are advertised by LLDP
|
||||
or CDP
|
||||
* Port MAC query now only returns distinct MAC's
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
|
||||
@@ -41,8 +41,9 @@ sub get_port_macs {
|
||||
|
||||
my $dp_macs
|
||||
= schema('netdisco')->resultset('DevicePort')
|
||||
->search( { mac => { '!=' => undef } },
|
||||
{ select => [ 'mac', 'ip' ] } );
|
||||
->search( { mac => { '!=', [ undef, '00:00:00:00:00:00' ] } },
|
||||
{ select => [ 'mac', 'ip' ],
|
||||
group_by => [ 'mac', 'ip' ] } );
|
||||
my $dp_cursor = $dp_macs->cursor;
|
||||
while ( my @vals = $dp_cursor->next ) {
|
||||
$port_macs->{ $vals[0] } = $vals[1];
|
||||
|
||||
Reference in New Issue
Block a user