aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-eth.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-10-21 17:31:22 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-10-21 17:31:22 +0000
commit3616fa1549ca6f76dafc7b66e591ebfce5399273 (patch)
treec06cc7e62b38c64b9001a8d7cfddf07ce084641d /epan/dissectors/packet-eth.c
parent2dafe09f0b890728430b34ba9184207039e05429 (diff)
Remove if (fh_tree) checks as add_ethernet_trailer() calls such functions as dissector_try_heuristic(), expert_add_info(), and col_append_str(), which all need to be called whether fh_tree is NULL or not.
#BACKPORT(1.10,1.8) svn path=/trunk/; revision=52738
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r--epan/dissectors/packet-eth.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c
index 62027bfe0c..c593de7b0b 100644
--- a/epan/dissectors/packet-eth.c
+++ b/epan/dissectors/packet-eth.c
@@ -570,7 +570,7 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree,
proto_item *item;
proto_tree *checksum_tree;
- if (trailer_tvb && fh_tree) {
+ if (trailer_tvb) {
guint trailer_length, trailer_reported_length;
guint padding_length = 0;
gboolean has_fcs = FALSE;
@@ -721,24 +721,24 @@ dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Some devices slice the packet and add their own trailer before
putting the frame on the network. Make sure these packets get
- a proper trailer (even though the sliced frame might not
- properly dissect. */
+ a proper trailer (even though the sliced frame might not
+ properly dissect. */
if ( (eth_trailer_length > 0) && (eth_trailer_length < tvb_length(tvb)) ) {
tvbuff_t *next_tvb;
- guint total_trailer_length;
+ guint total_trailer_length;
- total_trailer_length = eth_trailer_length + (eth_assume_fcs ? 4 : 0);
+ total_trailer_length = eth_trailer_length + (eth_assume_fcs ? 4 : 0);
- /* Dissect the tvb up to, but not including the trailer */
+ /* Dissect the tvb up to, but not including the trailer */
next_tvb = tvb_new_subset(tvb, 0,
tvb_length(tvb) - total_trailer_length,
- tvb_reported_length(tvb) - total_trailer_length);
+ tvb_reported_length(tvb) - total_trailer_length);
fh_tree = dissect_eth_common(next_tvb, pinfo, tree, 0);
- /* Now handle the ethernet trailer and optional FCS */
- next_tvb = tvb_new_subset_remaining(tvb, tvb_length(tvb) - total_trailer_length);
- add_ethernet_trailer(pinfo, tree, fh_tree, hf_eth_trailer, tvb, next_tvb,
- eth_assume_fcs ? 4 : pinfo->pseudo_header->eth.fcs_len);
+ /* Now handle the ethernet trailer and optional FCS */
+ next_tvb = tvb_new_subset_remaining(tvb, tvb_length(tvb) - total_trailer_length);
+ add_ethernet_trailer(pinfo, tree, fh_tree, hf_eth_trailer, tvb, next_tvb,
+ eth_assume_fcs ? 4 : pinfo->pseudo_header->eth.fcs_len);
} else {
dissect_eth_common(tvb, pinfo, tree, eth_assume_fcs ? 4 : pinfo->pseudo_header->eth.fcs_len);
}