bug - ADSL ifIndex to port error not handled (#15617)

* fix

* add an error message
This commit is contained in:
PipoCanaja
2023-12-05 14:11:46 +01:00
committed by GitHub
parent fe144d605a
commit c88fba0b64

View File

@@ -150,6 +150,12 @@ class Xdsl implements Module
$portAdsl->port_id = $os->ifIndexToId($ifIndex);
if ($portAdsl->port_id == 0) {
// failure of ifIndexToId(), port_id is invalid, and syncModels will crash
echo ' ADSL( Failed to discover this port, ifIndex invalid : ' . $portAdsl->adslLineCoding . '/' . Number::formatSi($portAdsl->adslAtucChanCurrTxRate, 2, 3, 'bps') . '/' . Number::formatSi($portAdsl->adslAturChanCurrTxRate, 2, 3, 'bps') . ') ';
continue;
}
if ($datastore) {
$this->storeAdsl($portAdsl, $data, (int) $ifIndex, $os, $datastore);
echo ' ADSL(' . $portAdsl->adslLineCoding . '/' . Number::formatSi($portAdsl->adslAtucChanCurrTxRate, 2, 3, 'bps') . '/' . Number::formatSi($portAdsl->adslAturChanCurrTxRate, 2, 3, 'bps') . ') ';