diff --git a/Changes b/Changes index fd7f867b..30fc6d9f 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ * #319 better fix for acceping ACL names or values in check_acl_* * #311 added duplicate devices report with option to delete + * #263 discover neighbors advertising ipv6 management addresses [BUG FIXES] @@ -11,7 +12,7 @@ * #318 ACLs with RegExp are very slow - aggressive resolver timeouts * #317 #265 #311 when renumbering on discover, delete likely duplicate devices * #316 neighbor map should fall back to device sysname after dns - * #310 multiple LLDP management addresses + * #310 allow multiple LLDP management addresses 2.036001 - 2017-06-22 diff --git a/lib/App/Netdisco/Core/Discover.pm b/lib/App/Netdisco/Core/Discover.pm index cb269c14..f3712a36 100644 --- a/lib/App/Netdisco/Core/Discover.pm +++ b/lib/App/Netdisco/Core/Discover.pm @@ -710,7 +710,15 @@ sub store_neighbors { _set_manual_topology($device, $snmp); my $c_ip = $snmp->c_ip; - unless ($snmp->hasCDP or scalar keys %$c_ip) { + my %c_ipv6 = %{ ($snmp->can('hasLLDP') and $snmp->hasLLDP) + ? $snmp->lldp_ipv6 : {} }; + + # remove keys with undef values, as c_ip does + delete @c_ipv6{ grep { not defined $c_ipv6{$_} } keys %c_ipv6 }; + # now combine them, v6 wins + $c_ip = { %$c_ip, %c_ipv6 }; + + unless (($snmp->can('hasCDP') and $snmp->hasCDP) or scalar keys %$c_ip) { debug sprintf ' [%s] neigh - CDP/LLDP not enabled!', $device->ip; return @to_discover; }