diff --git a/Netdisco/Changes b/Netdisco/Changes index 1c09ce9a..ee56ecb7 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -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] diff --git a/Netdisco/lib/App/Netdisco/Util/PortMAC.pm b/Netdisco/lib/App/Netdisco/Util/PortMAC.pm index 6aee6dda..b656e3a5 100644 --- a/Netdisco/lib/App/Netdisco/Util/PortMAC.pm +++ b/Netdisco/lib/App/Netdisco/Util/PortMAC.pm @@ -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];