From 13a9c636a52ae2c6e2bc2070f4a4f047afe6a6ef Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Wed, 15 Nov 2017 07:20:36 +0100 Subject: [PATCH] QUIC: STOP_SENDING error code is now application error code (with 2 bytes) Change-Id: I14ce4dc790da6d0b59514a5dcf28504d780934ea Reviewed-on: https://code.wireshark.org/review/24434 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-quic.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index 857b7dc144..44ed297017 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -101,6 +101,7 @@ static int hf_quic_frame_type_nci_connection_id = -1; static int hf_quic_frame_type_nci_stateless_reset_token = -1; static int hf_quic_frame_type_ss_stream_id = -1; static int hf_quic_frame_type_ss_error_code = -1; +static int hf_quic_frame_type_ss_application_error_code = -1; static int hf_quic_hash = -1; @@ -721,11 +722,17 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *quic_ proto_tree_add_item(ft_tree, hf_quic_frame_type_ss_stream_id, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; - proto_tree_add_item(ft_tree, hf_quic_frame_type_ss_error_code, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; + if(quic_info->version == 0xff000005 || quic_info->version == 0xff000006) { + proto_tree_add_item(ft_tree, hf_quic_frame_type_ss_error_code, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; - proto_item_set_len(ti_ft, 1 + 4 + 4); + proto_item_set_len(ti_ft, 1 + 4 + 4); + } else { + proto_tree_add_item(ft_tree, hf_quic_frame_type_ss_application_error_code, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + proto_item_set_len(ti_ft, 1 + 4 + 2); + } col_prepend_fstr(pinfo->cinfo, COL_INFO, "Stop Sending"); } @@ -1192,6 +1199,11 @@ proto_register_quic(void) FT_UINT32, BASE_DEC|BASE_EXT_STRING, &quic_error_code_vals_ext, 0x0, "Indicates why the sender is ignoring the stream", HFILL } }, + { &hf_quic_frame_type_ss_application_error_code, + { "Application Error code", "quic.frame_type.ss.application_error_code", + FT_UINT16, BASE_DEC|BASE_EXT_STRING, &quic_error_code_vals_ext, 0x0, + "Indicates why the sender is ignoring the stream", HFILL } + }, { &hf_quic_hash, { "Hash", "quic.hash",