make discover_{phones,waps} work with LLDP capabilities as well

This commit is contained in:
Oliver Gorwits
2019-03-03 13:00:36 +00:00
parent 189d234b55
commit b83e614c85
2 changed files with 12 additions and 5 deletions

View File

@@ -169,6 +169,7 @@ sub store_neighbors {
my $remote_port = undef;
my $remote_type = Encode::decode('UTF-8', $c_platform->{$entry} || '');
my $remote_id = Encode::decode('UTF-8', $c_id->{$entry});
my $remote_cap = $c_cap->{$entry} || [];
next unless $remote_ip;
my $r_netaddr = NetAddr::IP::Lite->new($remote_ip);
@@ -240,7 +241,7 @@ sub store_neighbors {
debug sprintf ' [%s] neigh - %s with ID [%s] on %s',
$device->ip, $remote_ip, ($remote_id || ''), $port;
if (is_discoverable($remote_ip, $remote_type)) {
if (is_discoverable($remote_ip, $remote_type, $remote_cap)) {
push @to_discover, [$remote_ip, $remote_id];
}
else {