moved interface.getStats call in periodic scripts to avoid that the current interface is changed by (unexpected) interface.select() calls in modules

This commit is contained in:
Alfredo Cardigliano 2018-10-17 19:49:07 +02:00
parent 70533877ca
commit c8438dfa66
4 changed files with 16 additions and 4 deletions

View file

@ -5,6 +5,10 @@
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
-- keep calling this before including modules to avoid that the
-- current interface is changed by (unexpected) interface.select() calls
local ifstats = interface.getStats()
require "lua_utils"
require "alert_utils"
local callback_utils = require "callback_utils"
@ -17,7 +21,6 @@ end
-- ########################################################
local verbose = ntop.verboseTrace()
local ifstats = interface.getStats()
local _ifname = ifstats.name
-- ########################################################