diff options
author | Gloria Pozuelo <gloria.pozuelo@bics.com> | 2015-11-03 16:49:32 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-11-08 17:04:18 +0000 |
commit | f30de770bd75ae633fcfe5351c4bc859524133ab (patch) | |
tree | c7bfa1c4f3229c6d5acb0fefc2a69b77f110775c | |
parent | a91df747a57c5a474d2748e215803e9659d684b3 (diff) | |
download | wireshark-f30de770bd75ae633fcfe5351c4bc859524133ab.tar.gz |
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>
(cherry picked from commit 0b3091fa359492a0fe7af50a42a2f70d85377a35)
Reviewed-on: https://code.wireshark.org/review/11642
-rw-r--r-- | epan/dissectors/packet-gtp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index e8dbde0152..448448a03c 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -7953,7 +7953,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; 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; @@ -8111,8 +8111,11 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) } 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 */ @@ -8136,6 +8139,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; @@ -8171,6 +8175,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; @@ -8307,7 +8312,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) { |