@@ -30,6 +30,10 @@ p_v2gtp.prefs["versioninfo"] = Pref.statictext("Version " .. v2gcommon.DS_V2GSHA
30
30
31
31
local V2GTP_HDR_LENGTH = 8
32
32
33
+ local function get_v2gtp_length (buf , pktinfo , offset )
34
+ return buf (offset + 4 ,4 ):uint () + V2GTP_HDR_LENGTH
35
+ end
36
+
33
37
local f_pv = ProtoField .uint8 (" v2gtp.protoversion" , " Protocol Version" , base .HEX )
34
38
local f_ipv = ProtoField .uint8 (" v2gtp.inverseprotoversion" , " Inverse Protocol Version" , base .HEX )
35
39
local f_pt = ProtoField .uint16 (" v2gtp.payloadtype" , " Payload Type" , base .HEX )
@@ -77,10 +81,6 @@ p_v2gtp.fields = {f_pv, f_ipv, f_pt, f_len}
77
81
78
82
-- PDU dissection function
79
83
local function v2gtp_pdu_dissect (buf , pinfo , root )
80
- if tostring (buf (0 , 2 )) ~= " 01fe" then
81
- return 0
82
- end
83
-
84
84
local p_type_num = buf (2 , 2 ):uint ()
85
85
local prev_proto = tostring (pinfo .cols .protocol )
86
86
171
171
172
172
-- main dissection function
173
173
function p_v2gtp .dissector (buf , pinfo , root )
174
- return v2gtp_pdu_dissect (buf , pinfo , root )
174
+ -- plausibility checks
175
+ if buf :len () < V2GTP_HDR_LENGTH then return 0 end
176
+ if tostring (buf (0 , 2 )) ~= " 01fe" then return 0 end
177
+
178
+ -- if above TCP we need to assemble the PDU
179
+ if pinfo .port_type == 2 then
180
+ dissect_tcp_pdus (buf , root , V2GTP_HDR_LENGTH , get_v2gtp_length , v2gtp_pdu_dissect )
181
+ return buf :len ()
182
+ else
183
+ return v2gtp_pdu_dissect (buf , pinfo , root )
184
+ end
175
185
end
176
186
177
187
-- initialization routine
0 commit comments