mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
xDP - ifAlias should be last checked in function find_port_id (#12904)
ifAlias should be last
This commit is contained in:
@@ -1352,11 +1352,6 @@ function find_port_id($description, $identifier = '', $device_id = 0, $mac_addre
|
||||
$params[] = $device_id;
|
||||
$params[] = $description;
|
||||
$params[] = $description;
|
||||
|
||||
// we check ifAlias last because this is a user editable field, but some bad LLDP implementations use it
|
||||
$statements[] = 'SELECT `port_id` FROM `ports` WHERE `device_id`=? AND `ifAlias`=?';
|
||||
$params[] = $device_id;
|
||||
$params[] = $description;
|
||||
}
|
||||
|
||||
if ($identifier) {
|
||||
@@ -1369,6 +1364,13 @@ function find_port_id($description, $identifier = '', $device_id = 0, $mac_addre
|
||||
$params[] = $identifier;
|
||||
$params[] = $identifier;
|
||||
}
|
||||
|
||||
if ($description) {
|
||||
// we check ifAlias last because this is a user editable field, but some bad LLDP implementations use it
|
||||
$statements[] = 'SELECT `port_id` FROM `ports` WHERE `device_id`=? AND `ifAlias`=?';
|
||||
$params[] = $device_id;
|
||||
$params[] = $description;
|
||||
}
|
||||
}
|
||||
|
||||
if ($mac_address) {
|
||||
|
Reference in New Issue
Block a user