From aac3bce7175c52b40f34bbe764a215769807efec Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Sat, 4 Jun 2005 10:23:10 +0000 Subject: fix #224: hierarchy stats had problems with the new generated toplevel desegmentation items "[Reassembled TCP Segments]" svn path=/trunk/; revision=14549 --- proto_hier_stats.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'proto_hier_stats.c') diff --git a/proto_hier_stats.c b/proto_hier_stats.c index 995a5c30f7..974d6dc1b3 100644 --- a/proto_hier_stats.c +++ b/proto_hier_stats.c @@ -92,10 +92,16 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu finfo = PITEM_FINFO(ptree_node); g_assert(finfo); - stat_node = find_stat_node(parent_stat_node, finfo->hfinfo); + /* 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) { + /* this should only happen for generated items */ + g_assert(PROTO_ITEM_IS_GENERATED(ptree_node)); + return; + } - /* Assert that the finfo is related to a protocol, not a field. */ - g_assert(finfo->hfinfo->parent == -1); + stat_node = find_stat_node(parent_stat_node, finfo->hfinfo); stats = STAT_NODE_STATS(stat_node); stats->num_pkts_total++; -- cgit v1.2.3