From eeff506f56c0f3a2e82d0007b7e0c5836be15a33 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 20 Jan 2016 01:46:34 -0800 Subject: Separate "Ethernet in capture file" and "Ethernet maybe with FCS" dissectors. Have a dissector that is passed a "struct eth_phdr" pointer, indicating whether there is an FCS, there is no FCS, or there's maybe an FCS, and an "eth_maybefcs" dissector, to be called from other dissectors. The latter takes no data argument. That obviates the need for callers of the latter to fill in an "eth_phdr" structure. Note in a comment that setting the "assume an FCS" preference overrides a file format handler in Wiretap saying "we have no FCS". I seem to remember that this might be intentional. Ping-Bug: 9933 Change-Id: I600e1351d468ab31d48369edb96832d6da3e480c Reviewed-on: https://code.wireshark.org/review/13432 Reviewed-by: Guy Harris --- epan/dissectors/packet-atm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'epan/dissectors/packet-atm.c') diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 57420f6c29..7634a7586b 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -145,7 +145,7 @@ static dissector_handle_t fr_handle; static dissector_handle_t llc_handle; static dissector_handle_t sscop_handle; static dissector_handle_t ppp_handle; -static dissector_handle_t eth_handle; +static dissector_handle_t eth_maybefcs_handle; static dissector_handle_t ip_handle; static dissector_handle_t data_handle; @@ -992,12 +992,9 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * See RFC 2684 section 6.2 "VC Multiplexing of Bridged * Protocols". */ - struct eth_phdr eth; - proto_tree_add_item(tree, hf_atm_padding, tvb, 0, 2, ENC_NA); next_tvb = tvb_new_subset_remaining(tvb, 2); - eth.fcs_len = -1; /* We don't know whether there's an FCS */ - call_dissector_with_data(eth_handle, next_tvb, pinfo, tree, ð); + call_dissector(eth_maybefcs_handle, next_tvb, pinfo, tree); decoded = TRUE; } else if (octet[2] == 0x03 && /* NLPID */ @@ -2018,7 +2015,7 @@ proto_reg_handoff_atm(void) llc_handle = find_dissector("llc"); sscop_handle = find_dissector("sscop"); ppp_handle = find_dissector("ppp"); - eth_handle = find_dissector("eth"); + eth_maybefcs_handle = find_dissector("eth_maybefcs"); ip_handle = find_dissector("ip"); data_handle = find_dissector("data"); -- cgit v1.2.3