diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-01-17 20:08:17 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-01-18 04:15:16 +0000 |
commit | 8ec153f93816a302a325e40924f4e13383ad8eaf (patch) | |
tree | 630efb01c710f8fd81c69f4c54dfd09873ec26fe /epan/dissectors/packet-eth.c | |
parent | 5fe11fb75964d8e0d87fb73d99aa5f69066b9e8f (diff) |
Have the "maybe an FCS" version of the Ethernet dissector take a data argument.
It's called from some places other than packet-frame.c, at least one of
which currently can't call anything else (the ATM dissector, for
VC-multiplexed bridged frames, where you don't know whether the frames
include the FCS or not), so the frame's pseudo-data doesn't necessarily
have the appropriate "FCS length" value. Have it explicitly check the
data argument, and explicitly pass the appropriate value to it.
Ping-Bug: 9933
Change-Id: I0c75f921d25d1e2b75e476c15ff9625205036b25
Reviewed-on: https://code.wireshark.org/review/13382
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r-- | epan/dissectors/packet-eth.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index 48840cf522..6904849976 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -795,8 +795,9 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, /* Called for the Ethernet Wiretap encapsulation type; pass the FCS length reported to us, or, if the "assume_fcs" preference is set, pass 4. */ static int -dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) +dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { + struct eth_phdr *eth = (struct eth_phdr *)data; proto_tree *fh_tree; /* Some devices slice the packet and add their own trailer before @@ -818,9 +819,9 @@ dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* /* Now handle the ethernet trailer and optional FCS */ next_tvb = tvb_new_subset_remaining(tvb, tvb_captured_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); + eth_assume_fcs ? 4 : eth->fcs_len); } else { - dissect_eth_common(tvb, pinfo, tree, eth_assume_fcs ? 4 : pinfo->pseudo_header->eth.fcs_len); + dissect_eth_common(tvb, pinfo, tree, eth_assume_fcs ? 4 : eth->fcs_len); } return tvb_captured_length(tvb); } |