- finfo = PITEM_FINFO(ptree_node);
- g_assert(finfo);
-
- stat_node = find_stat_node(parent_stat_node, finfo->ptr_u.hfinfo);
-
- /* Assert that the finfo is related to a protocol, not a field. */
- g_assert(finfo->ptr_u.hfinfo->parent == -1);
-
- stats = STAT_NODE_STATS(stat_node);
- stats->num_pkts_total++;
- stats->num_bytes_total += pkt_len;
+ finfo = PNODE_FINFO(ptree_node);
+ /* We don't fake protocol nodes we expect them to have a field_info */
+ g_assert(finfo && "dissection with faked proto tree?");
+
+ /* 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) {
+ /* Skip this element, use parent status node */
+ stat_node = parent_stat_node;
+ stats = STAT_NODE_STATS(stat_node);
+ } else {
+ stat_node = find_stat_node(parent_stat_node, finfo->hfinfo);
+
+ stats = STAT_NODE_STATS(stat_node);
+ stats->num_pkts_total++;
+ stats->num_bytes_total += pkt_len;
+ }