aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tr.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1998-09-17 03:29:28 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1998-09-17 03:29:28 +0000
commitf6daab52f55cdbd4dac2bd48974b39d12ff03a63 (patch)
treed886cf2ee6065a1b5e84dfdae0532c4bb7f86d76 /packet-tr.c
parentff28af3608a4b51dea4d96fc907ffb0e5f0f02f1 (diff)
Re-added fixes after cvs tree was changed.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tr.c')
-rw-r--r--packet-tr.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/packet-tr.c b/packet-tr.c
index 9f75ec180b..2d9a3dbe9f 100644
--- a/packet-tr.c
+++ b/packet-tr.c
@@ -2,7 +2,7 @@
* Routines for Token-Ring packet disassembly
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
- * $Id: packet-tr.c,v 1.2 1998/09/16 03:22:11 gerald Exp $
+ * $Id: packet-tr.c,v 1.3 1998/09/17 03:29:27 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -81,6 +81,7 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
int offset = 14;
int source_routed = 0;
int rif_bytes = 0;
+ int true_rif_bytes = 0; /* because of silly_linux */
guint8 nonsr_hwaddr[8];
int frame_type = (pd[1] & 192) >> 6; /* I use this value a lot */
#ifdef linux
@@ -104,13 +105,14 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
/* sometimes we have a RCF but no RIF... half source-routed? */
/* I'll check for 2 bytes of RIF and the 0x70 byte */
if (!source_routed) {
- if ((pd[14] & 31) == 2 && pd[15] == 0x70) {
+ if ((pd[14] & 31) == 2) {
source_routed = 1;
}
}
if (source_routed) {
rif_bytes = pd[14] & 31;
+ true_rif_bytes = rif_bytes;
}
/* this is a silly hack for Linux 2.0.x. Read the comment below,
in front of the other #ifdef linux */
@@ -163,8 +165,7 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
ether_to_str((guint8 *) &pd[8]));
if (source_routed) {
- add_item_to_tree(fh_tree, 14, 1, "RIF length: %d bytes",
- pd[14] & 31); /* not rif_bytes because of silly_linux */
+ add_item_to_tree(fh_tree, 14, 1, "RIF length: %d bytes", true_rif_bytes);
add_item_to_tree(fh_tree, 15, 1,
"%s, up to %d bytes in frame (LF=%d)",
@@ -179,7 +180,7 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
/* if we have more than 2 bytes of RIF, then we have
ring/bridge pairs */
- if ((pd[14] & 31) > 2) { /* not rif_bytes because of silly_linux */
+ if (true_rif_bytes > 2) {
add_ring_bridge_pairs(rif_bytes, pd, fh_tree);
}
}
@@ -194,8 +195,12 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
tcpdump. W/o that, however, I'm guessing that DSAP == SSAP if the
frame type is LLC. It's very much a hack. -- Gilbert Ramirez */
#ifdef linux
- if ( (source_routed && ((pd[14] & 31) == 2) && silly_linux) ||
- (!source_routed) && silly_linux ) {
+ if (source_routed && (true_rif_bytes == 2) && silly_linux) {
+ add_item_to_tree(fh_tree, 14 + true_rif_bytes, 18 - true_rif_bytes,
+ "Empty RIF from Linux 2.0.x driver. The sniffing NIC "
+ "is also running a protocol stack.");
+ }
+ else if ((!source_routed) && silly_linux ) {
add_item_to_tree(fh_tree, 14, 18,
"Empty RIF from Linux 2.0.x driver. The sniffing NIC "
"is also running a protocol stack.");