Added parameter for sql query to check ifPhysAddress as thats what lldpRemPortId is

This commit is contained in:
root 2015-12-09 20:37:15 +00:00
parent 810f53fac7
commit 8ed1a50657

View File

@ -147,7 +147,8 @@ if ($device['os'] == 'pbn' && $config['autodiscovery']['xdp'] === true) {
if ($remote_device_id) {
$if = $lldp['lldpRemPortDesc'];
$id = $lldp['lldpRemPortId'];
$remote_port_id = dbFetchCell('SELECT `port_id` FROM `ports` WHERE (`ifDescr` = ? OR `ifName` = ? OR `ifDescr` = ? OR `ifName` = ?) AND `device_id` = ?', array($if, $if, $id, $id, $remote_device_id));
$PhysAddress = preg_replace('/ /', '', $id);
$remote_port_id = dbFetchCell('SELECT `port_id` FROM `ports` WHERE (`ifDescr` = ? OR `ifName` = ? OR `ifDescr` = ? OR `ifName` = ? OR `ifPhysAddress` = ?) AND `device_id` = ?', array($if, $if, $id, $id, $PhysAddress, $remote_device_id));
}
else {
$remote_port_id = '0';