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:
Tony Murray
2017-10-15 13:49:28 -05:00
committed by Neil Lathwood
parent 348f5012b1
commit 2f2234da70

View File

@ -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();