Comment # 4
on bug 11514
from Xiaochuan Sun
The initial issue of blank info column after filtering can only be found for
the several new log formats I added. In those new log formats, I used global
array infoString[] to display info column string instead of usual const string
for each dissected protocol. Only Qt wireshark has blank info column issue, the
GTK wireshark works well. The strange thing is that the issue is not easily
reproduced on my PCs but easily reproduced on other PCs.
I wish I could push my personal code to git repository but I have modifed so
many codes, about 29k LOC, this is why I could not pusch my code.
Anyway, I found a workaround for crash issue and blank info column issue.
The col_add_str(pinfo->cinfo, COL_INFO, infoString) is widely used in my new
added log format, which should be the reason for the blank info column issue
after filtering.
guint8 infoString[COL_MAX_INFO_LEN];
static void dissect_tiger_trace_a01(tvbuff_t *tvb, tvbuff_t *header_tvb,
packet_info *pinfo, proto_tree *tree)
{
proto_item *info_item = NULL;
proto_tree *info_tree = NULL;
sprintf(infoString, "sfn=%04d.%1d MSG2 rnti=%d pid=%d TA=%d",
(tvb_get_ntohs(tvb, 2)&0xFFF0)>>4, //sfn
(tvb_get_ntohs(tvb, 2)&0x0F), //subframe
tvb_get_ntohs(tvb, 0), //rnti
(tvb_get_ntohs(tvb, 4)&0xFC00)>>10, //pid
tvb_get_ntohs(tvb, 4)&0x3FF); //TA
info_item = proto_tree_add_string(tree, hf_alf_info, tvb, 0,
tvb_captured_length_remaining(tvb, 0), infoString);
info_tree = proto_item_add_subtree(info_item, ett_alf);
proto_tree_add_string(info_tree, hf_alf_a01_trace_name, tvb, 0, 0,
"TRACE_RAC_MSG2_PDSCH");
dissect_tiger_trace_header(header_tvb, pinfo, info_tree);
proto_tree_add_item(info_tree, hf_alf_sfn, tvb, 2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_alf_subframe, tvb, 2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_alf_rnti, tvb, 0, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_alf_a01_pid, tvb, 4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(info_tree, hf_alf_a01_ta, tvb, 4, 2, ENC_BIG_ENDIAN);
col_add_str(pinfo->cinfo, COL_INFO, infoString);
col_set_fence(pinfo->cinfo, COL_INFO);
}
workaround for crash issue and blank info column issue:
cf_filter_packets(capture_file *cf, gchar *dftext, gboolean force)
{
if (dftext == NULL) {
if (cf->state != FILE_CLOSED) {
rescan_packets(cf, "Resetting", "Filter", TRUE);
}
else {
rescan_packets(cf, "Resetting", "Filter", FALSE);
}
} else {
if (cf->state != FILE_CLOSED) {
rescan_packets(cf, "Filtering", dftext, TRUE);
}
else {
rescan_packets(cf, "Filtering", dftext, FALSE);
}
}
}