mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: cdp matching incorrect ports (#7491)
Need either remote device_id or mac_address to find a port, otherwise, we might match an incorrect port.
This commit is contained in:
committed by
Neil Lathwood
parent
348f5012b1
commit
2f2234da70
@ -1424,6 +1424,10 @@ function find_device_id($name = '', $ip = '', $mac_address = '')
|
||||
*/
|
||||
function find_port_id($description, $identifier = '', $device_id = 0, $mac_address = null)
|
||||
{
|
||||
if (!($device_id || $mac_address)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$sql = 'SELECT `port_id` FROM `ports` WHERE (0';
|
||||
$params = array();
|
||||
|
||||
|
Reference in New Issue
Block a user