aboutsummaryrefslogtreecommitdiff
path: root/wireshark
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2020-05-27 13:08:00 +0200
committerNardi Ivan <nardi.ivan@gmail.com>2020-06-25 18:02:03 +0200
commit3c66ca236b0a1a4f62049af186247d4083ba99b7 (patch)
treedd2f0cd45a8ef3f7da936c4e0c683ce3159edb83 /wireshark
parent70a926088f64f3a12c4bd3373001281de6ab991f (diff)
Make lua script more robust
Diffstat (limited to 'wireshark')
-rw-r--r--wireshark/ndpi.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/wireshark/ndpi.lua b/wireshark/ndpi.lua
index 6038d8965..75ca95a70 100644
--- a/wireshark/ndpi.lua
+++ b/wireshark/ndpi.lua
@@ -895,10 +895,12 @@ function ndpi_proto.dissector(tvb, pinfo, tree)
-- The trick below avoids to process the packet twice
if(pinfo.visited == true) then
- local eth_trailer = f_eth_trailer()
+ local eth_trailer = {f_eth_trailer()}
- if(eth_trailer ~= nil) then
- local eth_trailer = getval(eth_trailer)
+ -- Depending on Wireshark configuration, there may be multiple ethernet trailer fields.
+ -- 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)
if(magic == "19:68:09:24") then