diff options
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r-- | epan/dissectors/packet-eth.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index 04e689fe8a..b5d45e95ef 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -799,8 +799,8 @@ 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 void -dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *fh_tree; @@ -827,21 +827,24 @@ dissect_eth_maybefcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { dissect_eth_common(tvb, pinfo, tree, eth_assume_fcs ? 4 : pinfo->pseudo_header->eth.fcs_len); } + return tvb_captured_length(tvb); } /* Called by other dissectors This one's for encapsulated Ethernet packets that don't include an FCS. */ -static void -dissect_eth_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_eth_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_eth_common(tvb, pinfo, tree, 0); + return tvb_captured_length(tvb); } /* ...and this one's for encapsulated packets that do. */ -static void -dissect_eth_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_eth_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { dissect_eth_common(tvb, pinfo, tree, 4); + return tvb_captured_length(tvb); } void @@ -1007,9 +1010,9 @@ proto_register_eth(void) "Set the condition that must be true for the CCSDS dissector to be called", &ccsds_heuristic_bit); - register_dissector("eth_withoutfcs", dissect_eth_withoutfcs, proto_eth); - register_dissector("eth_withfcs", dissect_eth_withfcs, proto_eth); - register_dissector("eth", dissect_eth_maybefcs, proto_eth); + new_register_dissector("eth_withoutfcs", dissect_eth_withoutfcs, proto_eth); + new_register_dissector("eth_withfcs", dissect_eth_withfcs, proto_eth); + new_register_dissector("eth", dissect_eth_maybefcs, proto_eth); eth_tap = register_tap("eth"); register_conversation_table(proto_eth, TRUE, eth_conversation_packet, eth_hostlist_packet); |