Implemented trick to avoid processing the packet twice
This commit is contained in:
@@ -101,7 +101,16 @@ function slen(str)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- the dissector function callback
|
-- the dissector function callback
|
||||||
|
local num_pkts = 0
|
||||||
|
|
||||||
function ndpi_proto.dissector(tvb, pinfo, tree)
|
function ndpi_proto.dissector(tvb, pinfo, tree)
|
||||||
|
num_pkts = num_pkts + 1
|
||||||
|
|
||||||
|
-- Wireshark dissects the packet twice. We ignore the first
|
||||||
|
-- run as on that step the packet is still undecoded
|
||||||
|
-- The trick below avoids to process the packet twice
|
||||||
|
if(num_pkts < pinfo.number) then return end
|
||||||
|
|
||||||
local pktlen = tvb:len()
|
local pktlen = tvb:len()
|
||||||
local eth_trailer = f_eth_trailer()
|
local eth_trailer = f_eth_trailer()
|
||||||
local magic = tostring(tvb(pktlen-28,4))
|
local magic = tostring(tvb(pktlen-28,4))
|
||||||
|
|||||||
Reference in New Issue
Block a user