diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-02-08 07:32:11 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-02-08 07:32:11 +0000 |
commit | 3a80e9d40229dcddb5b2f8e5ac6a272db6cad5f6 (patch) | |
tree | 0cf812eac7ecfc0a3bbd4b6f3f608b51d1df6622 /packet-bpdu.c | |
parent | 8eea536319e434e2f96887749c7b7a8eb85b9368 (diff) |
Don't fetch any of the fields past the BPDU type if the BPDU type isn't
0; topology change notification frames don't *have* anything past the
BPDU type to fetch.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3003 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-bpdu.c')
-rw-r--r-- | packet-bpdu.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/packet-bpdu.c b/packet-bpdu.c index bffedca2b8..4849d503b7 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.22 2001/02/08 03:59:12 guy Exp $ + * $Id: packet-bpdu.c,v 1.23 2001/02/08 07:32:11 guy Exp $ * * Copyright 1999 Christophe Tronche <ch.tronche@computer.org> * @@ -154,12 +154,23 @@ dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } bpdu_type = tvb_get_guint8(tvb, BPDU_TYPE); - flags = tvb_get_guint8(tvb, BPDU_FLAGS); - root_identifier_bridge_priority = tvb_get_ntohs(tvb, BPDU_ROOT_IDENTIFIER); - root_identifier_mac = tvb_get_ptr(tvb, BPDU_ROOT_IDENTIFIER + 2, 6); - root_identifier_mac_str = ether_to_str(root_identifier_mac); - root_path_cost = tvb_get_ntohl(tvb, BPDU_ROOT_PATH_COST); - port_identifier = tvb_get_ntohs(tvb, BPDU_PORT_IDENTIFIER); + if (bpdu_type == 0) { + flags = tvb_get_guint8(tvb, BPDU_FLAGS); + root_identifier_bridge_priority = tvb_get_ntohs(tvb, + BPDU_ROOT_IDENTIFIER); + root_identifier_mac = tvb_get_ptr(tvb, BPDU_ROOT_IDENTIFIER + 2, 6); + root_identifier_mac_str = ether_to_str(root_identifier_mac); + root_path_cost = tvb_get_ntohl(tvb, BPDU_ROOT_PATH_COST); + port_identifier = tvb_get_ntohs(tvb, BPDU_PORT_IDENTIFIER); + } else { + /* Squelch GCC complaints. */ + flags = 0; + root_identifier_bridge_priority = 0; + root_identifier_mac = NULL; + root_identifier_mac_str = NULL; + root_path_cost = 0; + port_identifier = 0; + } if (check_col(pinfo->fd, COL_INFO)) { if (bpdu_type == 0) |