Buffer value is set to null while using filter in protocol dissector
I have a custom dissector where the value of buffer contains the expected data when wireshark is loaded for first time. On using filter such as proto.field == value the buffer value becomes nil, but on reloading the Lua plugins the buffer value is displayed again. It seems erratic behavior where its difficult to figure out the root cause, is there any common behavior that I am missing to look at?
The issue is that the local buf displays the value on reloading the Lua plugins, in other occurrences it displays a
nil
code snippet
local id_list = IField.get('id', 0) -- get all id
local data_list = IField.get('data', 0) --get all data
for i,id in ipairs(id_list) do
local node = bit.band(id, 0xFF)
local data = data_list[i]
local seqn = data:get_index(0)
local payload = data:subset(1, data:len()-1)
if bit.band(seqn, 0x80) > 0 then -- first frame
packets[node] = ByteArray.new()
seqn = bit.bxor(seqn, 0x80)
end
local buf = packets[node]:tvb("My frame")