Merge pull request #15650 from SimonWalton-HiFi/dissectors-stun-filter

Use STUN RFC magic number to filter for such packets
This commit is contained in:
Simon Walton 2019-05-30 15:47:50 -07:00 committed by GitHub
commit 987d5e7662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,10 +163,14 @@ local unsourced_packet_types = {
local fragments = {}
local RFC_5389_MAGIC_COOKIE = 0x2112A442
function p_hfudt.dissector(buf, pinfo, tree)
-- make sure this isn't a STUN packet - those don't follow HFUDT format
if pinfo.dst == Address.ip("stun.highfidelity.io") then return end
-- make sure this isn't a STUN packet - those don't follow HFUDT format
if buf:len() >= 8 and buf(4, 4):uint() == RFC_5389_MAGIC_COOKIE then
return 0
end
-- validate that the packet length is at least the minimum control packet size
if buf:len() < 4 then return end