From 3f0ea18866ee4e3ab5cc1b3530365828c8b2f655 Mon Sep 17 00:00:00 2001 From: Nardi Ivan Date: Mon, 24 Jun 2024 16:54:48 +0200 Subject: wireshark: lua: fix DNS dissection Not sure when we (or Wireshark, or Lua...) broke it, but we can't call tonumber() on Bool variables. --- wireshark/ndpi.lua | 4 ++-- 1 file 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 -- cgit v1.2.3