Fix custom interface speed not accounted in ts_common.getMaxPointValue

This commit is contained in:
emanuele-f 2018-09-11 13:05:19 +02:00
parent 1dc6fce52d
commit 433cbb3142
5 changed files with 9 additions and 8 deletions

View file

@ -1872,12 +1872,13 @@ function tablePreferences(key, value, force_set)
end
end
function getInterfaceSpeed(ifstats)
local ifspeed = ntop.getCache('ntopng.prefs.'..ifstats.name..'.speed')
function getInterfaceSpeed(ifid)
local ifname = getInterfaceName(ifid)
local ifspeed = ntop.getCache('ntopng.prefs.'..ifname..'.speed')
if not isEmptyString(ifspeed) and tonumber(ifspeed) ~= nil then
ifspeed = tonumber(ifspeed)
else
ifspeed = ifstats.speed
ifspeed = interface.getMaxIfSpeed(ifid)
end
return ifspeed