Didier Gautheron:

Only call ether_to_str(), get_ether_name() if the tree is visible, they are slow.

svn path=/trunk/; revision=23666
This commit is contained in:
Anders Broman 2007-11-29 06:29:20 +00:00
parent 87503b059e
commit b1370e46d0
1 changed files with 7 additions and 3 deletions

View File

@ -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);
}