From 8d1b7d549337bd6e3cce495f36d50db9ac31ae35 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 17 May 2017 16:25:47 -0500 Subject: [PATCH] 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... --- includes/discovery/ports.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/discovery/ports.inc.php b/includes/discovery/ports.inc.php index fce43c3553..131550504e 100644 --- a/includes/discovery/ports.inc.php +++ b/includes/discovery/ports.inc.php @@ -65,11 +65,11 @@ foreach ($port_stats as $ifIndex => $port) { // We've seen it. Remove it from the cache. unset($ports_l[$ifIndex]); - } // Port vanished (mark as deleted) - else { + } else { + // Port vanished (mark as deleted) if (is_array($ports_db[$port_id])) { 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'; echo '-'; }