From 67b4650559fb309aaec4e1696f084e7c536cc54b Mon Sep 17 00:00:00 2001 From: John Thacker Date: Fri, 30 Sep 2022 00:16:51 -0400 Subject: [PATCH] fc: Fix Service Response Table The lun value is stored in the tree on the first pass. Do the lookup when it's not the first pass. Also add the display filter to the SRT table so that the GUI generated filters work properly. Fix #16084. --- epan/dissectors/packet-fc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index bbffb490aa..046143029c 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -240,7 +240,7 @@ fcstat_init(struct register_srt* srt _U_, GArray* srt_array) srt_stat_table *fc_srt_table; guint32 i; - fc_srt_table = init_srt_table("Fibre Channel Types", NULL, srt_array, FC_NUM_PROCEDURES, NULL, NULL, NULL); + fc_srt_table = init_srt_table("Fibre Channel Types", NULL, srt_array, FC_NUM_PROCEDURES, NULL, "fc.type", NULL); for (i = 0; i < FC_NUM_PROCEDURES; i++) { gchar* tmp_str = val_to_str_wmem(NULL, i, fc_fc4_val, "Unknown(0x%02x)"); @@ -753,7 +753,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean /* Set up LUN data. OXID + LUN make up unique exchanges, but LUN is populated in subdissectors and not necessarily in every frame. Stub it here for now */ fchdr->lun = 0xFFFF; - if (!pinfo->fd->visited) { + if (pinfo->fd->visited) { fchdr->lun = (guint16)GPOINTER_TO_UINT(wmem_tree_lookup32(fc_conv_data->luns, fchdr->oxid)); } @@ -1173,6 +1173,12 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean fchdr->fc_ex = fc_ex; + /* XXX: The ACK_1 frames (and other LINK_CONTROL frames) should + * probably be ignored (or treated specially) for SRT purposes, + * and not used to change the first exchange frame or start time + * of an exchange. + */ + /* populate the exchange struct */ if(!pinfo->fd->visited){ if(fchdr->fctl&FC_FCTL_EXCHANGE_FIRST){