aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2024-06-24 16:54:48 +0200
committerIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-06-25 16:39:45 +0200
commit3f0ea18866ee4e3ab5cc1b3530365828c8b2f655 (patch)
tree9015183a72206af2b8ce3e4515c91d062876cba3
parentb5afa165f0e799257a4e341e278290ff6c3568db (diff)
wireshark: lua: fix DNS dissection
Not sure when we (or Wireshark, or Lua...) broke it, but we can't call tonumber() on Bool variables.
-rw-r--r--wireshark/ndpi.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/wireshark/ndpi.lua b/wireshark/ndpi.lua
index c5b2fc4f3..24ec87c11 100644
--- a/wireshark/ndpi.lua
+++ b/wireshark/ndpi.lua
@@ -761,13 +761,13 @@ function dns_dissector(tvb, pinfo, tree)
local dns_response = f_dns_response()
if(dns_response ~= nil) then
local dns_ret_code = f_dns_ret_code()
- local dns_response = tonumber(getval(dns_response))
+ local dns_response = dns_response() -- conversion to true/false. We can't use tonumber() on Bool
local srckey = tostring(pinfo.src)
local dstkey = tostring(pinfo.dst)
local dns_query_name = f_dns_query_name()
dns_query_name = getval(dns_query_name)
- if(dns_response == 0) then
+ if(dns_response == false) then
-- DNS Query
if(dns_client_queries[srckey] == nil) then dns_client_queries[srckey] = 0 end
dns_client_queries[srckey] = dns_client_queries[srckey] + 1