diff options
author | John Thacker <johnthacker@gmail.com> | 2022-04-18 09:43:02 -0400 |
---|---|---|
committer | A Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2022-04-19 11:03:37 +0000 |
commit | ea62d7d6faa788803cd709480797ed295f5323a1 (patch) | |
tree | 5755e15455fff9ffd23b8baaeaa192e337b3e938 /ui | |
parent | 43828765c3fd85872143e3961b88888489526d5a (diff) |
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.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/proto_hier_stats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/proto_hier_stats.c b/ui/proto_hier_stats.c index 82c734cbb4..8386b09c7c 100644 --- a/ui/proto_hier_stats.c +++ b/ui/proto_hier_stats.c @@ -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); |