aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-eth.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2007-11-29 06:29:20 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2007-11-29 06:29:20 +0000
commit36d2b89cf7e8fa38f447361fbacf2594a446a847 (patch)
treed4352e35a2975e2c538b188208cfce6e9c61cee3 /epan/dissectors/packet-eth.c
parent434cf31c91b9a224390ab365b79c31ddfd70455f (diff)
Didier Gautheron:
Only call ether_to_str(), get_ether_name() if the tree is visible, they are slow. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23666 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r--epan/dissectors/packet-eth.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c
index b13cb08c01..39cb919636 100644
--- a/epan/dissectors/packet-eth.c
+++ b/epan/dissectors/packet-eth.c
@@ -304,13 +304,17 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
}
}
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (check_col(pinfo->cinfo, COL_INFO))
col_set_str(pinfo->cinfo, COL_INFO, "Ethernet II");
if (parent_tree) {
- ti = proto_tree_add_protocol_format(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE,
+ if (PTREE_DATA(parent_tree)->visible) {
+ ti = proto_tree_add_protocol_format(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE,
"Ethernet II, Src: %s (%s), Dst: %s (%s)",
get_ether_name(src_addr), ether_to_str(src_addr), get_ether_name(dst_addr), ether_to_str(dst_addr));
-
+ }
+ else {
+ ti = proto_tree_add_item(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, FALSE);
+ }
fh_tree = proto_item_add_subtree(ti, ett_ether2);
}