diff options
author | Flavio Santes <flavio.santes@1byt3.com> | 2017-11-10 12:35:49 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-11 09:33:48 +0000 |
commit | f35aa91c1a07e420b4d4a9c51342bddb8d3640c9 (patch) | |
tree | 296fa474c363e822b8121149b556bd6506ac3b22 /epan | |
parent | d337f4c5b74a2824bc7de34161ac30b54a3b0e4e (diff) |
dissector/mqtt: Dissect the UNSUBACK payload
MQTT v5.0/UNSUBACK includes a payload conformed
by a list of reason codes. There is no length
field for this payload, so it must be computed
as the difference between the full message size
and the current offset.
Change-Id: Ibf7ef4131408e26e2389c3ab89107c22c16412a1
Signed-off-by: Flavio Santes <flavio.santes@1byt3.com>
Reviewed-on: https://code.wireshark.org/review/24337
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mqtt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-mqtt.c b/epan/dissectors/packet-mqtt.c index f9bed189f8..b83fdd62dd 100644 --- a/epan/dissectors/packet-mqtt.c +++ b/epan/dissectors/packet-mqtt.c @@ -926,6 +926,12 @@ static int dissect_mqtt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi if (mqtt->runtime_proto_version == MQTT_PROTO_V50) { offset += dissect_mqtt_properties(tvb, mqtt_tree, offset); + + while (offset < tvb_reported_length(tvb)) + { + proto_tree_add_item(mqtt_tree, hf_mqtt_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + } } break; |