aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cisco-fp-mim.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-01-20 01:46:34 -0800
committerGuy Harris <guy@alum.mit.edu>2016-01-20 09:57:29 +0000
commiteeff506f56c0f3a2e82d0007b7e0c5836be15a33 (patch)
treed3f1260a5c9c8bd90dff67182257df2e0444a7cd /epan/dissectors/packet-cisco-fp-mim.c
parent47648e0528f091a6c7525d9d880f85a0a5fa42d0 (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-cisco-fp-mim.c')
-rw-r--r--epan/dissectors/packet-cisco-fp-mim.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/epan/dissectors/packet-cisco-fp-mim.c b/epan/dissectors/packet-cisco-fp-mim.c
index 845515d935..3fcd9cbded 100644
--- a/epan/dissectors/packet-cisco-fp-mim.c
+++ b/epan/dissectors/packet-cisco-fp-mim.c
@@ -72,7 +72,7 @@ static const true_false_string ooodl_tfs = {
"Deliver in order (If DA) or Learn (If SA)"
};
-static dissector_handle_t eth_dissector ;
+static dissector_handle_t eth_maybefcs_dissector ;
#define FP_PROTO_COL_NAME "FabricPath"
@@ -218,7 +218,6 @@ dissect_fp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
guint16 dlid = 0;
const guint8 *dst_addr = NULL;
gboolean dest_ig = FALSE;
- struct eth_phdr eth;
col_set_str( pinfo->cinfo, COL_PROTOCOL, FP_PROTO_COL_NAME ) ;
col_set_str( pinfo->cinfo, COL_INFO, FP_PROTO_COL_INFO ) ;
@@ -295,11 +294,9 @@ dissect_fp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/* call the eth dissector */
next_tvb = tvb_new_subset_remaining( tvb, FP_HEADER_SIZE) ;
/*
- * For now, say we don't know whether there's an FCS in the
- * captured data.
+ * For now, we don't know whether there's an FCS in the captured data.
*/
- eth.fcs_len = -1;
- call_dissector_with_data( eth_dissector, next_tvb, pinfo, tree, &eth ) ;
+ call_dissector( eth_maybefcs_dissector, next_tvb, pinfo, tree ) ;
return tvb_captured_length( tvb ) ;
}
@@ -416,7 +413,7 @@ proto_reg_handoff_fabricpath(void)
* by the Ethernet dissector. This needs more work, so we leave this
* as calling the "eth" dissector as a reminder.
*/
- eth_dissector = find_dissector( "eth" );
+ eth_maybefcs_dissector = find_dissector( "eth_maybefcs" );
prefs_initialized = TRUE;
}
}