Fix protocol categories association lost after reboot

After the recent changes, there is only one global nDPI struct which
is share across all the interfaces. However, the struct can be swapped
during normal operating, so it's necessary to reload the associations
every time a new nDPI struct is allocated.

Fixes #3139
This commit is contained in:
emanuele-f 2019-12-19 15:08:27 +01:00
parent d69367f7be
commit 139a16ffe3
12 changed files with 82 additions and 67 deletions

View file

@ -104,7 +104,7 @@ local function matchesCategoryFilter(item_id)
return true
end
local cat = interface.getnDPIProtoCategory(tonumber(item_id))
local cat = ntop.getnDPIProtoCategory(tonumber(item_id))
return category == cat.name
end
@ -119,7 +119,7 @@ for item_name, item_id in pairs(items) do
goto continue
end
local cat = interface.getnDPIProtoCategory(tonumber(item_id))
local cat = ntop.getnDPIProtoCategory(tonumber(item_id))
items[item_name] = { name = item_name, id = item_id, conf = device_policies[tonumber(item_id)], catName = cat.name }
num_items = num_items + 1