ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Unregistered header fields in packet-fcdns.c

From: Richard Sharpe <realrichardsharpe@xxxxxxxxx>
Date: Mon, 9 Sep 2019 14:51:37 -0700
On Mon, Sep 9, 2019 at 2:47 PM Christian Svensson via Wireshark-dev
<wireshark-dev@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I was doing an analysis of Fibre Channel frames when I started to see:
> 16:18:24.982          Warn Dissector bug, protocol FC-dNS, in packet 1403: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:18:24.983          Warn Dissector bug, protocol FC-dNS, in packet 1421: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:18:26.072          Warn Dissector bug, protocol FC-dNS, in packet 1403: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:18:26.075          Warn Dissector bug, protocol FC-dNS, in packet 1421: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:19:11.822          Warn Dissector bug, protocol FC-dNS, in packet 1403: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:19:11.823          Warn Dissector bug, protocol FC-dNS, in packet 1421: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:19:21.424          Warn Dissector bug, protocol FC-dNS, in packet 1403: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:19:21.425          Warn Dissector bug, protocol FC-dNS, in packet 1421: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:19:26.560          Warn Dissector bug, protocol FC-dNS, in packet 1403: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
> 16:19:26.580          Warn Dissector bug, protocol FC-dNS, in packet 1421: epan/proto.c:5036: failed assertion "(guint)hfindex < gpa_hfinfo.len" (Unregistered hf!)
>
> I looked at the packet-fcdns.c and it seems there are some hfis that are created but never registered. The following patch seems to make the error go away.
>
> diff -ur t/wireshark-3.1.0/epan/dissectors/packet-fcdns.c wireshark-3.1.0/epan/dissectors/packet-fcdns.c
> --- t/wireshark-3.1.0/epan/dissectors/packet-fcdns.c 2019-07-25 11:47:24.000000000 -0700
> +++ wireshark-3.1.0/epan/dissectors/packet-fcdns.c 2019-09-07 16:33:43.029546894 -0700
> @@ -2006,6 +2006,10 @@
>          &hfi_fcdns_fc4features,
>          &hfi_fcdns_fc4features_i,
>          &hfi_fcdns_fc4features_t,
> +        &hfi_fcdns_id_length,
> +        &hfi_fcdns_num_entries,
> +        &hfi_fcdns_zone_flags,
> +        &hfi_fcdns_zonelen,
>      };
>  #endif

You might also run ./tools/checkhf.pl across the dissector to see if
you caught them all.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)(传说杜康是酒的发明者)