aboutsummaryrefslogtreecommitdiffstats
path: root/packet-eth.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-01-22 06:26:36 +0000
committerGuy Harris <guy@alum.mit.edu>2003-01-22 06:26:36 +0000
commite120160577df46123fa7c0e80e552f708487fef9 (patch)
tree22c2c3d3dabcca88c698b7f38f1e088711eed9f3 /packet-eth.c
parenta4280bade5973de55506ab23b433b493651fc02a (diff)
From Dinesh Dutt:
- A new decoder called MDSHDR which decodes the internal header of the Cisco MDS switch (this is different from the Boardwalk header). - Support for some more new columns as part of FC support. - Fixed the decoding of the Special Frame in FCIP. - Fixed the decoding of credit management type field in FLOGI/PLOGI frame in FC-ELS. svn path=/trunk/; revision=6974
Diffstat (limited to 'packet-eth.c')
-rw-r--r--packet-eth.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/packet-eth.c b/packet-eth.c
index 08ceb01473..c13e88ea8d 100644
--- a/packet-eth.c
+++ b/packet-eth.c
@@ -1,7 +1,7 @@
/* packet-eth.c
* Routines for ethernet packet disassembly
*
- * $Id: packet-eth.c,v 1.78 2003/01/22 01:18:03 sahlberg Exp $
+ * $Id: packet-eth.c,v 1.79 2003/01/22 06:26:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -87,8 +87,23 @@ capture_eth(const guchar *pd, int offset, int len, packet_counts *ld)
etype = pntohs(&pd[offset+12]);
- /* either ethernet802.3 or ethernet802.2 */
- if (etype <= IEEE_802_3_MAX_LEN) {
+ /*
+ * If the type/length field is <= the maximum 802.3 length,
+ * and is not zero, this is an 802.3 frame, and it's a length
+ * field; it might be an Novell "raw 802.3" frame, with no
+ * 802.2 LLC header, or it might be a frame with an 802.2 LLC
+ * header.
+ *
+ * If the type/length field is > the maximum 802.3 length,
+ * this is an Ethernet II frame, and it's a type field.
+ *
+ * If the type/length field is zero (ETHERTYPE_UNK), this is
+ * a frame used internally by the Cisco MDS switch to contain
+ * Fibre Channel ("Vegas"). We treat that as an Ethernet II
+ * frame; the dissector for those frames registers itself with
+ * an ethernet type of ETHERTYPE_UNK.
+ */
+ if (etype <= IEEE_802_3_MAX_LEN && etype != ETHERTYPE_UNK) {
length = etype;
/* Is there an 802.2 layer? I can tell by looking at the first 2
@@ -160,8 +175,23 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ehdr.type = tvb_get_ntohs(tvb, 12);
- /* either ethernet802.3 or ethernet802.2 */
- if (ehdr.type <= IEEE_802_3_MAX_LEN) {
+ /*
+ * If the type/length field is <= the maximum 802.3 length,
+ * and is not zero, this is an 802.3 frame, and it's a length
+ * field; it might be an Novell "raw 802.3" frame, with no
+ * 802.2 LLC header, or it might be a frame with an 802.2 LLC
+ * header.
+ *
+ * If the type/length field is > the maximum 802.3 length,
+ * this is an Ethernet II frame, and it's a type field.
+ *
+ * If the type/length field is zero (ETHERTYPE_UNK), this is
+ * a frame used internally by the Cisco MDS switch to contain
+ * Fibre Channel ("Vegas"). We treat that as an Ethernet II
+ * frame; the dissector for those frames registers itself with
+ * an ethernet type of ETHERTYPE_UNK.
+ */
+ if (ehdr.type <= IEEE_802_3_MAX_LEN && ehdr.type != ETHERTYPE_UNK) {
/* Oh, yuck. Cisco ISL frames require special interpretation of the
destination address field; fortunately, they can be recognized by
checking the first 5 octets of the destination address, which are