aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-quic.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2017-01-13 13:49:41 +0100
committerMichael Mann <mmann78@netscape.net>2017-01-19 04:58:00 +0000
commit755ccae9bf0cc9e32a845fc36bbeaadc885fab6b (patch)
tree083240ae1774ee4179f0a18134e99b96a68fa533 /epan/dissectors/packet-quic.c
parent7f52ff06a4c40661c3c57a33bfe499589de8d0ca (diff)
QUIC: fix dissection of ACK Frame
First Ack Block is always present in ACK Frame (don't depend of present of NACK) Change-Id: I702151a6ccb236272ace9dfdf0f4b507a549871e Reviewed-on: https://code.wireshark.org/review/19627 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-quic.c')
-rw-r--r--epan/dissectors/packet-quic.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c
index ac419882f9..5b51724f3c 100644
--- a/epan/dissectors/packet-quic.c
+++ b/epan/dissectors/packet-quic.c
@@ -1072,7 +1072,7 @@ static guint32 get_len_missing_packet(guint8 frame_type){
static gboolean is_quic_unencrypt(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint16 len_pkn, quic_info_data_t *quic_info){
guint8 frame_type;
- guint8 num_ranges, num_revived, num_blocks, num_timestamp;
+ guint8 num_ranges, num_revived, num_blocks = 0, num_timestamp;
guint32 len_stream = 0, len_offset = 0, len_data = 0, len_largest_observed = 1, len_missing_packet = 1;
guint32 message_tag;
@@ -1277,18 +1277,16 @@ static gboolean is_quic_unencrypt(tvbuff_t *tvb, packet_info *pinfo, guint offse
}
num_blocks = tvb_get_guint8(tvb, offset);
offset += 1;
+ }
- if(num_blocks){
- /* First Ack Block Length */
- offset += len_missing_packet;
-
- /* Gap to next block */
- offset += 1;
-
- num_blocks -= 1;
- offset += (num_blocks - 1)*len_missing_packet;
- }
+ /* First Ack Block Length */
+ offset += len_missing_packet;
+ if(num_blocks){
+ /* Gap to next block */
+ offset += 1;
+ num_blocks -= 1;
+ offset += (num_blocks - 1)*len_missing_packet;
}
/* Timestamp */
@@ -1660,7 +1658,7 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree
proto_item *ti, *ti_ft, *ti_ftflags /*, *expert_ti*/;
proto_tree *ft_tree, *ftflags_tree;
guint8 frame_type;
- guint8 num_ranges, num_revived, num_blocks, num_timestamp;
+ guint8 num_ranges, num_revived, num_blocks = 0, num_timestamp;
guint32 tag_number;
guint32 len_stream = 0, len_offset = 0, len_data = 0, len_largest_observed = 1, len_missing_packet = 1;
@@ -1946,26 +1944,25 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree
proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_num_blocks, tvb, offset, 1, ENC_LITTLE_ENDIAN);
num_blocks = tvb_get_guint8(tvb, offset);
offset += 1;
+ }
- if(num_blocks){
- /* First Ack Block Length */
- proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_first_ack_block_length, tvb, offset, len_missing_packet, ENC_LITTLE_ENDIAN);
- offset += len_missing_packet;
+ /* First Ack Block Length */
+ proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_first_ack_block_length, tvb, offset, len_missing_packet, ENC_LITTLE_ENDIAN);
+ offset += len_missing_packet;
- /* Gap to next block */
- proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_gap_to_next_block, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- offset += 1;
+ if(num_blocks){
+ /* Gap to next block */
+ proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_gap_to_next_block, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ offset += 1;
- num_blocks -= 1;
- while(num_blocks){
- /* Ack Block Length */
- proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_ack_block_length, tvb, offset, len_missing_packet, ENC_LITTLE_ENDIAN);
- offset += len_missing_packet;
+ num_blocks -= 1;
+ while(num_blocks){
+ /* Ack Block Length */
+ proto_tree_add_item(ft_tree, hf_quic_frame_type_ack_ack_block_length, tvb, offset, len_missing_packet, ENC_LITTLE_ENDIAN);
+ offset += len_missing_packet;
- num_blocks--;
- }
+ num_blocks--;
}
-
}
/* Timestamp */