Make lua script more robust

This commit is contained in:
Nardi Ivan
2020-06-25 18:02:03 +02:00
parent 70a926088f
commit 3c66ca236b
+5 -3
View File
@@ -895,10 +895,12 @@ function ndpi_proto.dissector(tvb, pinfo, tree)
-- The trick below avoids to process the packet twice -- The trick below avoids to process the packet twice
if(pinfo.visited == true) then if(pinfo.visited == true) then
local eth_trailer = f_eth_trailer() local eth_trailer = {f_eth_trailer()}
if(eth_trailer ~= nil) then -- Depending on Wireshark configuration, there may be multiple ethernet trailer fields.
local eth_trailer = getval(eth_trailer) -- Ours should be the last one, anyway
if(eth_trailer[#eth_trailer] ~= nil) then
local eth_trailer = getval(eth_trailer[#eth_trailer])
local magic = string.sub(eth_trailer, 1, 11) local magic = string.sub(eth_trailer, 1, 11)
if(magic == "19:68:09:24") then if(magic == "19:68:09:24") then