aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAlexander Stein <alexanders83@web.de>2015-03-20 20:24:34 +0100
committerMichael Mann <mmann78@netscape.net>2015-03-20 23:46:32 +0000
commit6c383407895c09abd3988c1ae90de758b462072f (patch)
tree99df1b43c2318947c1dcdd0a623636777f93fb60 /epan
parent2afb52461cd379c2e13d8f29f6436c50279aa399 (diff)
MQTT: Prevent subsequent messages from overwriting the Info column
Without a fence col_add_fstr will overwrite the whole column on each message. Instead of adding a fence and adding the message info use col_append_sep_str which also supports a separator out of the box. e.g. "Connect Command, Publish Message, Disconnect Req" Change-Id: I346d9b659a044143cd31f08081ad145b9186307c Signed-off-by: Alexander Stein <alexanders83@web.de> Reviewed-on: https://code.wireshark.org/review/7771 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-mqtt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mqtt.c b/epan/dissectors/packet-mqtt.c
index 3435750edd..e4a7ff2883 100644
--- a/epan/dissectors/packet-mqtt.c
+++ b/epan/dissectors/packet-mqtt.c
@@ -192,7 +192,7 @@ static int dissect_mqtt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
mqtt_msg_type = mqtt_fixed_hdr >> 4;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MQTT");
- col_add_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(mqtt_msg_type, &mqtt_msgtype_vals_ext, "Unknown (0x%02x)"));
+ col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_ext(mqtt_msg_type, &mqtt_msgtype_vals_ext, "Unknown (0x%02x)"));
if(tree)
{
@@ -435,6 +435,8 @@ XXX: ToDo: Commit a fix for the case of the length field spread across TCP segme
static int dissect_mqtt_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
+ col_clear(pinfo->cinfo, COL_INFO);
+
tcp_dissect_pdus(tvb, pinfo, tree,
reassemble_mqtt_over_tcp,
2, /* Length can be determined within 5 bytes */