feature/capture: fix wireshark decoding and add new disco frame types (#16089)

Fix the wireshark lua dissector to support 0 bit position
and not throw modulo div by 0 errors.

Add new disco frame types to the decoder.

Updates tailscale/corp#29036

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
This commit is contained in:
Mike O'Driscoll 2025-05-26 10:23:30 -04:00 committed by GitHub
parent 09582bdc00
commit cd49faa123
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
function hasbit(x, p) function hasbit(x, p)
return x % (p + p) >= p return bit.band(x, p) ~= 0
end end
tsdebug_ll = Proto("tsdebug", "Tailscale debug") tsdebug_ll = Proto("tsdebug", "Tailscale debug")
@ -128,6 +128,10 @@ function tsdisco_frame.dissector(buffer, pinfo, tree)
if message_type == 1 then subtree:add(DISCO_TYPE, "Ping") if message_type == 1 then subtree:add(DISCO_TYPE, "Ping")
elseif message_type == 2 then subtree:add(DISCO_TYPE, "Pong") elseif message_type == 2 then subtree:add(DISCO_TYPE, "Pong")
elseif message_type == 3 then subtree:add(DISCO_TYPE, "Call me maybe") elseif message_type == 3 then subtree:add(DISCO_TYPE, "Call me maybe")
elseif message_type == 4 then subtree:add(DISCO_TYPE, "Bind UDP Relay Endpoint")
elseif message_type == 5 then subtree:add(DISCO_TYPE, "Bind UDP Relay Endpoint Challenge")
elseif message_type == 6 then subtree:add(DISCO_TYPE, "Bind UDP Relay Endpoint Answer")
elseif message_type == 7 then subtree:add(DISCO_TYPE, "Call me maybe via")
end end
-- Message version -- Message version