aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-09-17 13:03:52 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2018-09-19 22:36:25 +0000
commit0598fcab933216b47d33267b53a65f060b0e50d6 (patch)
treebf5a92ed7d609e0023e539253737d4193897af9a /epan
parent8f08a4e74ea8aa56284e6035017adf1c423c4f09 (diff)
QUIC: simplify PADDING frame
Report the correct amount of padding (including the "Frame Type" field) and remove the explicit padding field. Change-Id: I4ecfb0daae0bca727400b9db5ac9881d404120cf Ping-Bug: 13881 Reviewed-on: https://code.wireshark.org/review/29692 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-quic.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c
index 706b743217..13d7cbc627 100644
--- a/epan/dissectors/packet-quic.c
+++ b/epan/dissectors/packet-quic.c
@@ -88,7 +88,6 @@ static int hf_quic_frame_type_path_challenge_data = -1;
static int hf_quic_frame_type_path_response_data = -1;
static int hf_quic_frame_type_padding_length = -1;
-static int hf_quic_frame_type_padding = -1;
static int hf_quic_frame_type_rsts_stream_id = -1;
static int hf_quic_frame_type_rsts_application_error_code = -1;
static int hf_quic_frame_type_rsts_final_offset = -1;
@@ -903,26 +902,18 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree
switch(frame_type){
case FT_PADDING:{
- proto_item *ti_pad_len;
- guint32 padding_offset = offset, pad_len;
+ guint32 pad_len;
col_append_fstr(pinfo->cinfo, COL_INFO, ", PADDING");
- /* get length of padding (with check if it is always a 0) */
- while ( tvb_reported_length_remaining(tvb, padding_offset) > 0) {
- if(tvb_get_guint8(tvb, padding_offset) != 0){
- break;
- }
- padding_offset ++;
- }
- pad_len = padding_offset - offset;
-
- ti_pad_len = proto_tree_add_uint(ft_tree, hf_quic_frame_type_padding_length, tvb, offset, 0, pad_len);
- PROTO_ITEM_SET_GENERATED(ti_pad_len);
+ /* A padding frame consists of a single zero octet, but for brevity
+ * sake let's combine multiple zeroes into a single field. */
+ pad_len = 1 + tvb_skip_guint8(tvb, offset, tvb_reported_length_remaining(tvb, offset), '\0') - offset;
+ ti = proto_tree_add_uint(ft_tree, hf_quic_frame_type_padding_length, tvb, offset, 0, pad_len);
+ PROTO_ITEM_SET_GENERATED(ti);
proto_item_append_text(ti_ft, " Length: %u", pad_len);
- proto_tree_add_item(ft_tree, hf_quic_frame_type_padding, tvb, offset, pad_len, ENC_NA);
- offset += pad_len;
- proto_item_set_len(ti_ft, 1+pad_len);
+ offset += pad_len - 1;
+ proto_item_set_len(ti_ft, pad_len);
}
break;
case FT_RST_STREAM:{
@@ -2565,15 +2556,10 @@ proto_register_quic(void)
},
/* PADDING */
{ &hf_quic_frame_type_padding_length,
- { "Padding Length", "quic.frame_type.padding.length",
+ { "Padding Length", "quic.frame_type.padding_length",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
- { &hf_quic_frame_type_padding,
- { "Padding", "quic.frame_type.padding",
- FT_BYTES, BASE_NONE, NULL, 0x0,
- "Must be zero", HFILL }
- },
/* RST_STREAM */
{ &hf_quic_frame_type_rsts_stream_id,
{ "Stream ID", "quic.frame_type.rsts.stream_id",