diff options
author | Flavio Santes <flavio.santes@1byt3.com> | 2017-11-07 01:25:32 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-11-07 12:30:32 +0000 |
commit | 1344e707b7e8aabc3b12ffd00e5595310e5508cb (patch) | |
tree | 37f283e735b02727b9ece5f3213cb4d2a76de215 /epan/dissectors/packet-mqtt.c | |
parent | d84d43372c3aee0ae5a1dd30edff8243acf41f14 (diff) |
dissector/mqtt: Disconnect and Auth variable header
Apply 'Disconnect' (3.14.2) and 'Auth' (3.15.2-1) notes to simplify
and fix the variable header :).
Change-Id: I169a69a0da5b2d5ee338c0f45af978217986f37a
Signed-off-by: Flavio Santes <flavio.santes@1byt3.com>
Reviewed-on: https://code.wireshark.org/review/24274
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-mqtt.c')
-rw-r--r-- | epan/dissectors/packet-mqtt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-mqtt.c b/epan/dissectors/packet-mqtt.c index 377055903e..6fddbe8bcc 100644 --- a/epan/dissectors/packet-mqtt.c +++ b/epan/dissectors/packet-mqtt.c @@ -725,8 +725,6 @@ static int dissect_mqtt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi case MQTT_PUBCOMP: proto_tree_add_item(mqtt_tree, hf_mqtt_msgid, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - /* FALLTHROUGH */ - case MQTT_DISCONNECT: if (mqtt->runtime_proto_version == MQTT_PROTO_V50) { proto_tree_add_item(mqtt_tree, hf_mqtt_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -751,6 +749,12 @@ static int dissect_mqtt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi case MQTT_PINGRESP: break; + case MQTT_DISCONNECT: + /* MQTT v5.0: Byte 1 in the Variable Header is the Disconnect Reason Code. + * If the Remaining Length is less than 1 the value of 0x00 + * (Normal disconnection) is used. + */ + /* FALLTHROUGH */ case MQTT_AUTH: /* MQTT v5.0: The Reason Code and Property Length can be omitted if * the Reason Code is 0x00 (Success) and there are no Properties. |