Wireshark 4.05 to 4.07 broke lua dissector
I have a lua dissector that works just fine in 4.05 but in 4.07 it does not work. I get a range nil in the lua console window. I tracked it down to dissect_tcp_pdus. It does not call my get_len_func or dissect_func. Does anyone know if there was some breaking changed between the two version?
function cac_protocol.dissector(buffer, pinfo, tree)
length = buffer:len()
pinfo.cols.protocol = cac_protocol.name
if length == 0 then
return
end
local subtree = tree:add(cac_protocol, buffer(), "CAC Protocol Data")
--I get here
print("dissect_tcp_pdus:" )
dissect_tcp_pdus(buffer, subtree, 4, get_pdu_len, do_dissection)
end
function get_pdu_len(tvb, pinfo, tree)
--I dont get here
print("get_pdu_len:")
return tvb(0, 4):int() *4
end
function do_dissection(tvb, pinfo, tree)
--I dont get here
print("do_dissection:")
--CODE Removed
end
Is it possible to test with a more current version of Wireshark?
Download Wireshark
Same issue on 4.2.4, I showed the 4.05 to 4.07 because that's where it broke.
Registering as a post dissector produces this output:
How are you registering the protocol?
Well I had my plugins in the global plugins directory. I then moved them to the personal plugins directory to make it easier to edit them and bingo they work like they are supposed to. Move them back to global they don't work. Don't know why they will work in personal but not global I don't know.
YMMV but may be similar to gotchas in: 18589: Lua Personal vs Global Plugin Failure