Skip to content

Commit 02471b4

Browse files
authored
wireshark: fix Lua 5.4 bitwise operation (#1776)
The Nebula Wireshark dissector uses bit32.band() when parsing the Nebula packet type. On Wireshark builds using Lua 5.4, bit32 is not available, which causes dissection to fail with: Lua Error: nebula.lua:65: attempt to index a nil value (global 'bit32') Wireshark bundles Lua BitOp and exposes it globally as bit for Lua dissectors. This is the documented API for maximum backwards compatibility across supported Lua versions. Use bit.band() instead of bit32.band().
1 parent 58ab725 commit 02471b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dist/wireshark/nebula.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function nebula.dissector(tvbuf, pktinfo, root)
6262
tree:add(pf_version, tvbuf:range(0,1))
6363
local type = tree:add(pf_type, tvbuf:range(0,1))
6464

65-
local nebula_type = bit32.band(tvbuf:range(0,1):uint(), 0x0F)
65+
local nebula_type = bit.band(tvbuf:range(0,1):uint(), 0x0F)
6666
if nebula_type == 0 then
6767
local stage = tvbuf(8,8):uint64()
6868
tree:add(pf_subtype_handshake, tvbuf:range(1,1))

0 commit comments

Comments
 (0)