hierarchy stats: Don't add text only fields to the hierarchy

Use proto_registrar_is_protocol instead of directly comparing
hfinfo->parent to -1 when determining if the field info is related
to a protocol or not.

This avoids adding the special case text only field, which does not
have a parent protocol id, to the protocol hierarchy. These fields are
merely strings on the GUI tree, not actual protocols.
This commit is contained in:
John Thacker 2022-04-18 09:43:02 -04:00 committed by A Wireshark GitLab Utility
parent 43828765c3
commit ea62d7d6fa
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps)
/* If the field info isn't related to a protocol but to a field,
* don't count them, as they don't belong to any protocol.
* (happens e.g. for toplevel tree item of desegmentation "[Reassembled TCP Segments]") */
if (finfo->hfinfo->parent != -1) {
if (!proto_registrar_is_protocol(finfo->hfinfo->id)) {
/* Skip this element, use parent status node */
stat_node = parent_stat_node;
stats = STAT_NODE_STATS(stat_node);