diff --git a/Changes b/Changes index 0490c70045..70751a90f3 100644 --- a/Changes +++ b/Changes @@ -52,6 +52,7 @@ netdiscovery/netinventory: * Fix #481: Add Synology NAS support * Fix #480: Add CheckPoint support * Fix #488: Update HP Printers support +* Updated LLDP/CDP connection match checks collect: * Thanks to David Durieux, add support for dynamic pattern in registry key diff --git a/lib/FusionInventory/Agent/Tools/Hardware.pm b/lib/FusionInventory/Agent/Tools/Hardware.pm index a8e8ac5520..1b843547c0 100644 --- a/lib/FusionInventory/Agent/Tools/Hardware.pm +++ b/lib/FusionInventory/Agent/Tools/Hardware.pm @@ -1033,7 +1033,21 @@ sub _setConnectedDevices { my $cdp_connection = $cdp_info->{$interface_id}; if ($lldp_connection) { - if ($cdp_connection->{SYSDESCR} eq $lldp_connection->{SYSDESCR}) { + my $match = 0; + + # Try different case to find LLDP/CDP connection match + if ($lldp_connection->{SYSDESCR} && $cdp_connection->{SYSDESCR} eq $lldp_connection->{SYSDESCR}) { + $match ++; + } elsif ($lldp_connection->{SYSNAME} && $cdp_connection->{SYSNAME}) { + my $cdp_test = getCanonicalMacAddress($cdp_connection->{SYSNAME}); + if ($cdp_connection->{SYSNAME} eq $lldp_connection->{SYSNAME}) { + $match ++; + } elsif ($lldp_connection->{SYSMAC} && $cdp_test && $lldp_connection->{SYSMAC} eq $cdp_test) { + $match ++; + } + } + + if ($match) { # same device, everything OK foreach my $key (qw/IP MODEL/) { $lldp_connection->{$key} = $cdp_connection->{$key};