aboutsummaryrefslogtreecommitdiffstats
path: root/packet-bpdu.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-01-05 17:26:10 +0000
committerGuy Harris <guy@alum.mit.edu>2004-01-05 17:26:10 +0000
commit8128e99879c29c6a59aff920d8b97060de495f71 (patch)
tree6d7cfd3f4eb33b6e42e63640db1a6e085e1c0b40 /packet-bpdu.c
parent108b5cb25638e2b8d3cfba86f21dd69fdfe5d5bb (diff)
From Alex Rozin: fix handling of MST messages.
Fix his e-mail address. svn path=/trunk/; revision=9556
Diffstat (limited to 'packet-bpdu.c')
-rw-r--r--packet-bpdu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/packet-bpdu.c b/packet-bpdu.c
index 4812193559..c128505959 100644
--- a/packet-bpdu.c
+++ b/packet-bpdu.c
@@ -1,7 +1,7 @@
/* packet-bpdu.c
* Routines for BPDU (Spanning Tree Protocol) disassembly
*
- * $Id: packet-bpdu.c,v 1.47 2003/09/21 20:06:00 gerald Exp $
+ * $Id: packet-bpdu.c,v 1.48 2004/01/05 17:26:10 guy Exp $
*
* Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
*
@@ -71,7 +71,7 @@
#define CONF_BPDU_SIZE 35
#define TC_BPDU_SIZE 4
#define RST_BPDU_SIZE 36
-#define VERSION_3_STATIC_LENGTH 64
+#define VERSION_3_STATIC_LENGTH 66
#define MSTI_MESSAGE_SIZE 16
/* Flag bits */
@@ -339,7 +339,9 @@ dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case BPDU_TYPE_RST:
if (protocol_version_identifier == 3) {
version_3_length = tvb_get_ntohs(tvb, BPDU_VERSION_3_LENGTH);
- set_actual_length(tvb, RST_BPDU_SIZE + 2 + version_3_length);
+ set_actual_length(tvb, RST_BPDU_SIZE +
+ VERSION_3_STATIC_LENGTH +
+ version_3_length * MSTI_MESSAGE_SIZE);
} else
set_actual_length(tvb, RST_BPDU_SIZE);
break;
@@ -513,8 +515,8 @@ dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
BPDU_CIST_REMAINING_HOPS, 1, cist_remaining_hops);
/* MSTI messages */
- length = version_3_length - VERSION_3_STATIC_LENGTH;
offset = BPDU_MSTI;
+ length = tvb_reported_length_remaining(tvb, offset);
msti = 1;
while (length >= MSTI_MESSAGE_SIZE) {
msti_regional_root_mstid = tvb_get_guint8(tvb, offset+ MSTI_REGIONAL_ROOT);