aboutsummaryrefslogtreecommitdiffstats
path: root/proto_hier_stats.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-01-25 23:00:29 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-01-25 23:00:29 +0000
commit0ffcdf3be02544b8925b4780e0925dea2aca0552 (patch)
treea937e2fff7fc2895a7448ecc4d6042c7d9568031 /proto_hier_stats.c
parentc474f8287ac354a5da4d75ee3d6991a247cc4c0a (diff)
Fix for bug #1325: Protocol hierarchy display shows an empty line because of
the hop-by-hop option header tree in the main protocol tree. This fix skips those entries that don't have a name assigned to them and goes on to the next entry before adding it to the protocol hierarchy display. svn path=/trunk/; revision=20558
Diffstat (limited to 'proto_hier_stats.c')
-rw-r--r--proto_hier_stats.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/proto_hier_stats.c b/proto_hier_stats.c
index 8706001e64..3710f4f565 100644
--- a/proto_hier_stats.c
+++ b/proto_hier_stats.c
@@ -34,6 +34,7 @@
#include <wtap.h>
#include <stdio.h>
+#include <string.h>
#include <glib.h>
/* Update the progress bar this many times when scanning the packet list. */
@@ -107,6 +108,14 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu
proto_sibling_node = ptree_node->next;
if (proto_sibling_node) {
+ /* If the name does not exist for this proto_sibling_node, then it is
+ * not a normal protocol in the top-level tree. It was instead
+ * added as a normal tree such as IPv6's Hop-by-hop Option Header and
+ * should be skipped when creating the protocol hierarchy display. */
+ if(strlen(proto_sibling_node->finfo->hfinfo->name) == 0 &&
+ ptree_node->next)
+ proto_sibling_node = proto_sibling_node->next;
+
process_node(proto_sibling_node, stat_node, ps, pkt_len);
}
else {