From a4135d359cd6ad4614434916a304ae8b34a18ff1 Mon Sep 17 00:00:00 2001 From: George Hilliard Date: Sat, 18 Apr 2020 21:28:05 -0500 Subject: [PATCH] dissector: fix multi-packet handling --- dissector/baichuan.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dissector/baichuan.lua b/dissector/baichuan.lua index c9e0337..200e169 100644 --- a/dissector/baichuan.lua +++ b/dissector/baichuan.lua @@ -59,6 +59,13 @@ function bc_protocol.dissector(buffer, pinfo, tree) length = buffer:len() if length == 0 then return end + if buffer:len() < 20 then + -- Need more bytes but we don't have a header to learn how many bytes + pinfo.desegment_len = DESEGMENT_ONE_MORE_SEGMENT + pinfo.desegment_offset = 0 + return + end + pinfo.cols.protocol = bc_protocol.name local magic = buffer(0, 4):le_uint() @@ -69,11 +76,6 @@ function bc_protocol.dissector(buffer, pinfo, tree) return 0 end - if buffer:len() < 20 then - -- Need more bytes but we don't have a header to learn how many bytes - return DESEGMENT_ONE_MORE_SEGMENT - end - local msg_type = buffer(4, 4):le_uint() local msg_type_str = message_types[msg_type] or "unknown" local msg_len = buffer(8, 4):le_uint()