Merge pull request #2591 from laf/2581

Added parameter for sql query to check ifPhysAddress as thats what lldpRemPortId is
This commit is contained in:
Daniel Preussker
2015-12-10 06:18:56 +00:00
@@ -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';