From 301fa0057e30ac0826b3b65588064d98c688cc10 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Mon, 7 Mar 2016 21:52:20 -0500 Subject: Use field info length instead of packet length for protocol hierarchy stats. Bug: 1885 Change-Id: If2b68365880f3508ed82947a0d18e6c28d6e4db8 Reviewed-on: https://code.wireshark.org/review/14392 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/proto_hier_stats.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ui/proto_hier_stats.c') diff --git a/ui/proto_hier_stats.c b/ui/proto_hier_stats.c index dea3c3e92c..0963a7bcf3 100644 --- a/ui/proto_hier_stats.c +++ b/ui/proto_hier_stats.c @@ -73,7 +73,7 @@ find_stat_node(GNode *parent_stat_node, header_field_info *needle_hfinfo) static void -process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, guint pkt_len) +process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps) { field_info *finfo; ph_stats_node_t *stats; @@ -97,7 +97,7 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu stats = STAT_NODE_STATS(stat_node); stats->num_pkts_total++; - stats->num_bytes_total += pkt_len; + stats->num_bytes_total += finfo->length; } proto_sibling_node = ptree_node->next; @@ -110,17 +110,17 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu if(strlen(PNODE_FINFO(proto_sibling_node)->hfinfo->name) == 0 && ptree_node->next) proto_sibling_node = proto_sibling_node->next; - process_node(proto_sibling_node, stat_node, ps, pkt_len); + process_node(proto_sibling_node, stat_node, ps); } else { stats->num_pkts_last++; - stats->num_bytes_last += pkt_len; + stats->num_bytes_last += finfo->length; } } static void -process_tree(proto_tree *protocol_tree, ph_stats_t* ps, guint pkt_len) +process_tree(proto_tree *protocol_tree, ph_stats_t* ps) { proto_node *ptree_node; @@ -138,7 +138,7 @@ process_tree(proto_tree *protocol_tree, ph_stats_t* ps, guint pkt_len) return; } - process_node(ptree_node, ps->stats_tree, ps, pkt_len); + process_node(ptree_node, ps->stats_tree, ps); } static gboolean @@ -163,7 +163,7 @@ process_record(capture_file *cf, frame_data *frame, column_info *cinfo, ph_stats epan_dissect_run(&edt, cf->cd_t, &phdr, frame_tvbuff_new_buffer(frame, &buf), frame, cinfo); /* Get stats from this protocol tree */ - process_tree(edt.tree, ps, frame->pkt_len); + process_tree(edt.tree, ps); if (frame->flags.has_ts) { /* Update times */ -- cgit v1.2.1