Ethereal-dev: [Ethereal-dev] Bug in packet_bpdu.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Kaloian Stoilov <kalkata@xxxxxxxxx>
Date: Wed, 30 Apr 2003 06:44:08 -0700 (PDT)

Hi ,

I got the version 0.9.11 and it seems that in packet_bpdu.c you have some bugs. In msti instances flags are wrong . So I think that the code below will fix them

file packet_bpdu.c from line 532 to line 555 should be replaced with :

 msti_item = proto_tree_add_text(mstp_tree, tvb, offset, 16,
   "MSTID %d, Regional Root Identifier %d / %s",
   msti_regional_root_mstid, msti_regional_root_priority,
   msti_regional_root_mac_str);
      msti_tree = proto_item_add_subtree(msti_item, ett_msti);
      flags = tvb_get_guint8(tvb, offset+MSTI_FLAGS);
      /* flags */
      flags_item = proto_tree_add_uint(msti_tree, hf_bpdu_msti_flags, tvb,
   offset+MSTI_FLAGS, 1, flags);
      flags_tree = proto_item_add_subtree(flags_item, ett_bpdu_flags);

      sep = initial_sep;
      APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_TCACK, flags_item, "%sMaster");
      proto_tree_add_boolean(flags_tree, hf_bpdu_flags_tcack, tvb,
      offset+MSTI_FLAGS, 1, flags);
 
      APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_AGREEMENT, flags_item, "%sAgreement");
      proto_tree_add_boolean(flags_tree, hf_bpdu_flags_agreement, tvb,
      offset+MSTI_FLAGS, 1, flags);

      APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_FORWARDING, flags_item, "%sForwarding");
      proto_tree_add_boolean(flags_tree, hf_bpdu_flags_forwarding, tvb,
      offset+MSTI_FLAGS, 1, flags);

      APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_LEARNING, flags_item, "%sLearning");
      proto_tree_add_boolean(flags_tree, hf_bpdu_flags_learning, tvb,
      offset+MSTI_FLAGS, 1, flags);

      if (flags_item) {
   guint8 port_role;
   port_role = (flags & BPDU_FLAGS_PORT_ROLE_MASK) >> BPDU_FLAGS_PORT_ROLE_SHIFT;
   proto_item_append_text(flags_item, "%sPort Role: %s", sep,
           val_to_str(port_role, role_vals,
        "Unknown (%u)"));
      }
      sep = cont_sep;
      proto_tree_add_uint(flags_tree, hf_bpdu_flags_port_role, tvb,
          offset+MSTI_FLAGS, 1, flags);
      APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_PROPOSAL, flags_item, "%sProposal");
             proto_tree_add_boolean(flags_tree, hf_bpdu_flags_proposal, tvb,
      offset+MSTI_FLAGS, 1, flags);
      APPEND_BOOLEAN_FLAG(flags & BPDU_FLAGS_TC, flags_item, "%sTopology Change");
          proto_tree_add_boolean(flags_tree, hf_bpdu_flags_tc, tvb,
    offset+MSTI_FLAGS, 1, flags);
      if (sep != initial_sep) {        /* We put something in; put in the terminating ")" */
   proto_item_append_text(flags_item, ")");
      }


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.