aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGloria Pozuelo <gloria.pozuelo@bics.com>2015-11-03 16:49:32 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-11-08 17:02:53 +0000
commit0b3091fa359492a0fe7af50a42a2f70d85377a35 (patch)
tree523fdf85d057824d3848849807595c039a151025
parent7d8a094acb9d11a35f33ce12611cd2e0db2da894 (diff)
GTP sequence number fix for allowing to have sequence number equal to 0
Change-Id: Id8aad52198905eb33ecccf5ace01287954f31d2e Reviewed-on: https://code.wireshark.org/review/11526 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-gtp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index 4556c0706b..06df44c7c0 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -8138,7 +8138,7 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree *gtp_tree = NULL, *ext_tree;
proto_item *ti = NULL, *tf, *ext_hdr_len_item, *message_item;
int i, offset = 0, checked_field, mandatory;
- gboolean gtp_prime;
+ gboolean gtp_prime, has_SN;
int seq_no = 0;
int flow_label = 0;
guint8 pdu_no, next_hdr = 0;
@@ -8318,8 +8318,11 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_uint(gtp_tree, hf_gtp_length, tvb, 2, 2, gtp_hdr->length);
offset += 2;
+ /* We initialize the sequence number*/
+ has_SN = FALSE;
if (gtp_prime) {
seq_no = tvb_get_ntohs(tvb, offset);
+ has_SN = TRUE;
proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
offset += 2;
/* If GTP' version is 0 and bit 1 is 0 20 bytes header is used, dissect it */
@@ -8343,6 +8346,7 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
switch (gtp_version) {
case 0:
seq_no = tvb_get_ntohs(tvb, offset);
+ has_SN = TRUE;
proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
offset += 2;
@@ -8378,6 +8382,7 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
particular flag for the field is set. */
if (gtp_hdr->flags & GTP_S_MASK) {
seq_no = tvb_get_ntohs(tvb, offset);
+ has_SN = TRUE;
proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
}
offset += 2;
@@ -8514,7 +8519,7 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
/*Use sequence number to track Req/Resp pairs*/
- if (seq_no) {
+ if (has_SN) {
gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr->message, gtp_info);
/*pass packet to tap for response time reporting*/
if (gcrp) {