Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at packet-ieee802a.c:105

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

dissect_ieee802a

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ieee802a.c)expand/collapse
Show more  
 82  dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 83  {
 84          proto_tree      *ieee802a_tree = NULL;
 85          proto_item      *ti;
 86          int             offset = 0;
 87          tvbuff_t        *next_tvb;
 88          guint32         oui;
 89          guint16         etype;
 90          oui_info_t      *oui_info;
 91          dissector_table_t subdissector_table;
 92          int             hf;
 93   
 94          if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
 95                  col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE802a");
 96          }
 97          if (check_col(pinfo->cinfo, COL_INFO)) {
 98                  col_clear(pinfo->cinfo, COL_INFO);
 99          }
 100   
 101          if (tree) {
 102                  ti = proto_tree_add_item(tree, proto_ieee802a, tvb, 0, -1, FALSE);
 103                  ieee802a_tree = proto_item_add_subtree(ti, ett_ieee802a);
 104          } else 
 105                  ieee802a_tree = NULL;
 106   
 107          oui =   tvb_get_ntoh24(tvb, offset);
 108          etype = tvb_get_ntohs(tvb, offset+3);
 109   
 110          if (check_col(pinfo->cinfo, COL_INFO)) {
 111                  col_add_fstr(pinfo->cinfo, COL_INFO,
 112                      "OUI 0x%06X (%s), PID 0x%04X",
 113                      oui, val_to_str(oui, oui_vals, "Unknown"), etype);
 114          }
 115          if (tree) {
 116                  proto_tree_add_uint(ieee802a_tree, hf_ieee802a_oui,
 117                      tvb, offset, 3, oui);
 118          }
 119   
 120          /*
 121           * Do we have information for this OUI?
 122           */
 123          if (oui_info_table != NULL &&
 124              (oui_info = g_hash_table_lookup(oui_info_table,
 125                GUINT_TO_POINTER(oui))) != NULL) {
 126                  /*
 127                   * Yes - use it.
 128                   */
 129                  hf = *oui_info->field_info->p_id;
 130                  subdissector_table = oui_info->table;
 131          } else {
 132                  /*
 133                   * No, use hf_ieee802a_pid for the PID and just dissect
 134                   * the payload as data.
 135                   */
 136                  hf = hf_ieee802a_pid;
 137                  subdissector_table = NULL;
 138          }
 139          if (tree)
 140                  proto_tree_add_uint(ieee802a_tree, hf, tvb, offset+3, 2, etype);
 141          next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
 142          if (subdissector_table != NULL) {
 143                  /* do lookup with the subdissector table */
 144                  if (dissector_try_port(subdissector_table, etype, next_tvb,
 145                      pinfo, tree))
 146                          return;
 147          }
 148          call_dissector(data_handle, next_tvb, pinfo, tree);
 149  }
Show more  




Change Warning 2666.32333 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: