mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: fix marking invalid ports as deleted in discovery (#6665)
There seem to be other issues in this file, such as $ports_l is never defined...
This commit is contained in:
committed by
Neil Lathwood
parent
390dd0bece
commit
8d1b7d5493
@@ -65,11 +65,11 @@ foreach ($port_stats as $ifIndex => $port) {
|
|||||||
|
|
||||||
// We've seen it. Remove it from the cache.
|
// We've seen it. Remove it from the cache.
|
||||||
unset($ports_l[$ifIndex]);
|
unset($ports_l[$ifIndex]);
|
||||||
} // Port vanished (mark as deleted)
|
} else {
|
||||||
else {
|
// Port vanished (mark as deleted)
|
||||||
if (is_array($ports_db[$port_id])) {
|
if (is_array($ports_db[$port_id])) {
|
||||||
if ($ports_db[$port_id]['deleted'] != '1') {
|
if ($ports_db[$port_id]['deleted'] != '1') {
|
||||||
dbUpdate(array('deleted' => '1'), 'ports', "`port_id` = ?, `ifName` => '?', `ifAlias` => '?', `ifDescr` => '?'", array($port_id, $ifName, $ifAlias, $ifDescr));
|
dbUpdate(array('deleted' => '1'), 'ports', '`port_id` = ?', array($port_id));
|
||||||
$ports_db[$port_id]['deleted'] = '1';
|
$ports_db[$port_id]['deleted'] = '1';
|
||||||
echo '-';
|
echo '-';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user