diff --git a/includes/discovery/fdb-table/vrp.inc.php b/includes/discovery/fdb-table/vrp.inc.php index fcfa3224b6..f1166c404d 100644 --- a/includes/discovery/fdb-table/vrp.inc.php +++ b/includes/discovery/fdb-table/vrp.inc.php @@ -22,7 +22,10 @@ if (!empty($fdbPort_table)) { // Collect data and populate $insert foreach ($fdbPort_table as $mac => $data) { foreach ($data[$data_oid] as $vlan => $basePort) { - $ifIndex=$basePort[0]; + $ifIndex=reset($basePort); // $baseport can be ['' => '119'] or ['0' => '119'] + if (! $ifIndex) { + continue; + } $port = get_port_by_index_cache($device['device_id'], $ifIndex); $port_id = $port['port_id']; $mac_address = implode(array_map('zeropad', explode(':', $mac))); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ca0cd6bcf7..cb3ea93ad5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -44,7 +44,7 @@ ini_set('display_errors', 1); $snmpsim = new Snmpsim('127.1.6.2', 1162, null); if (getenv('SNMPSIM')) { - $snmpsim->fork(); + $snmpsim->fork(6); // make PHP hold on a reference to $snmpsim so it doesn't get destructed register_shutdown_function(function (Snmpsim $ss) {