Remove incorrect 'if (tree)'
authorBill Meier <wmeier@newsguy.com>
Fri, 23 Jan 2015 05:24:46 +0000 (00:24 -0500)
committerBill Meier <wmeier@newsguy.com>
Fri, 23 Jan 2015 05:30:55 +0000 (05:30 +0000)
Incorrect because of one or both of the following:
- col_...()/expert...() called under 'if (tree)'
- vars set under 'if (tree)' used later (not under 'if (tree)'
   as args to col_...()/expert_...()

Change-Id: I89f7d453f2d6eaa40d51cbd794ed2c9be7e549de
Reviewed-on: https://code.wireshark.org/review/6754
Reviewed-by: Bill Meier <wmeier@newsguy.com>
epan/dissectors/packet-extreme.c
epan/dissectors/packet-ismacryp.c
epan/dissectors/packet-kdp.c
epan/dissectors/packet-lacp.c
epan/dissectors/packet-mgcp.c
epan/dissectors/packet-netflow.c
epan/dissectors/packet-tivoconnect.c
epan/dissectors/packet-v52.c

index 8ed737f190ef6d07f1c26134e0a168141138bf45..ad127db779495ba6fcd54e54ab61ea23db6f5fdb 100644 (file)
@@ -968,132 +968,130 @@ dissect_edp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
        col_set_str(pinfo->cinfo, COL_INFO, PROTO_SHORT_NAME ":");
 
-       if (tree) {
-               ti = proto_tree_add_item(tree, proto_edp, tvb, offset, -1,
-                   ENC_NA);
-               edp_tree = proto_item_add_subtree(ti, ett_edp);
+       ti = proto_tree_add_item(tree, proto_edp, tvb, offset, -1,
+                                ENC_NA);
+       edp_tree = proto_item_add_subtree(ti, ett_edp);
 
-               proto_tree_add_item(edp_tree, hf_edp_version, tvb, offset, 1,
-                       ENC_BIG_ENDIAN);
-               offset += 1;
+       proto_tree_add_item(edp_tree, hf_edp_version, tvb, offset, 1,
+                           ENC_BIG_ENDIAN);
+       offset += 1;
 
-               proto_tree_add_item(edp_tree, hf_edp_reserved, tvb, offset, 1,
-                       ENC_BIG_ENDIAN);
-               offset += 1;
+       proto_tree_add_item(edp_tree, hf_edp_reserved, tvb, offset, 1,
+                           ENC_BIG_ENDIAN);
+       offset += 1;
 
-               data_length = tvb_get_ntohs(tvb, offset);
-               proto_tree_add_uint(edp_tree, hf_edp_length, tvb, offset, 2,
-                       data_length);
-               offset += 2;
+       data_length = tvb_get_ntohs(tvb, offset);
+       proto_tree_add_uint(edp_tree, hf_edp_length, tvb, offset, 2,
+                           data_length);
+       offset += 2;
 
-               packet_checksum = tvb_get_ntohs(tvb, offset);
-               /*
-                * If we have the entire ESP packet available, check the checksum.
-                */
-               if (tvb_length(tvb) >= data_length) {
-                       /* Checksum from version to null tlv */
-                       SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, data_length);
-                       computed_checksum = in_cksum(&cksum_vec[0], 1);
-                       checksum_good = (computed_checksum == 0);
-                       checksum_bad = !checksum_good;
-                       if (checksum_good) {
-                               checksum_item = proto_tree_add_uint_format(edp_tree,
-                                       hf_edp_checksum, tvb, offset, 2, packet_checksum,
-                                       "Checksum: 0x%04x [correct]",
-                                       packet_checksum);
-                       } else {
-                               checksum_item = proto_tree_add_uint_format(edp_tree,
-                                       hf_edp_checksum, tvb, offset, 2, packet_checksum,
-                                       "Checksum: 0x%04x [incorrect, should be 0x%04x]",
-                                       packet_checksum,
-                                       in_cksum_shouldbe(packet_checksum, computed_checksum));
-                       }
+       packet_checksum = tvb_get_ntohs(tvb, offset);
+       /*
+        * If we have the entire ESP packet available, check the checksum.
+        */
+       if (tvb_length(tvb) >= data_length) {
+               /* Checksum from version to null tlv */
+               SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, data_length);
+               computed_checksum = in_cksum(&cksum_vec[0], 1);
+               checksum_good = (computed_checksum == 0);
+               checksum_bad = !checksum_good;
+               if (checksum_good) {
+                       checksum_item = proto_tree_add_uint_format(edp_tree,
+                                                                  hf_edp_checksum, tvb, offset, 2, packet_checksum,
+                                                                  "Checksum: 0x%04x [correct]",
+                                                                  packet_checksum);
                } else {
-                       checksum_good = checksum_bad = FALSE;
-                       checksum_item = proto_tree_add_uint(edp_tree, hf_edp_checksum,
-                               tvb, offset, 2, packet_checksum);
+                       checksum_item = proto_tree_add_uint_format(edp_tree,
+                                                                  hf_edp_checksum, tvb, offset, 2, packet_checksum,
+                                                                  "Checksum: 0x%04x [incorrect, should be 0x%04x]",
+                                                                  packet_checksum,
+                                                                  in_cksum_shouldbe(packet_checksum, computed_checksum));
                }
-               checksum_tree = proto_item_add_subtree(checksum_item, ett_edp_checksum);
-               checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_good,
-                       tvb, offset, 2, checksum_good);
-               PROTO_ITEM_SET_GENERATED(checksum_item);
-               checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_bad,
-                       tvb, offset, 2, checksum_bad);
-               PROTO_ITEM_SET_GENERATED(checksum_item);
-               offset += 2;
+       } else {
+               checksum_good = checksum_bad = FALSE;
+               checksum_item = proto_tree_add_uint(edp_tree, hf_edp_checksum,
+                                                   tvb, offset, 2, packet_checksum);
+       }
+       checksum_tree = proto_item_add_subtree(checksum_item, ett_edp_checksum);
+       checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_good,
+                                              tvb, offset, 2, checksum_good);
+       PROTO_ITEM_SET_GENERATED(checksum_item);
+       checksum_item = proto_tree_add_boolean(checksum_tree, hf_edp_checksum_bad,
+                                              tvb, offset, 2, checksum_bad);
+       PROTO_ITEM_SET_GENERATED(checksum_item);
+       offset += 2;
 
-               seqno = tvb_get_ntohs(tvb, offset);
-               proto_tree_add_item(edp_tree, hf_edp_seqno, tvb, offset, 2,
-                       ENC_BIG_ENDIAN);
-               offset += 2;
+       seqno = tvb_get_ntohs(tvb, offset);
+       proto_tree_add_item(edp_tree, hf_edp_seqno, tvb, offset, 2,
+                           ENC_BIG_ENDIAN);
+       offset += 2;
 
-               /* Machine ID is 8 bytes, if it starts with 0000, the remaining
-                  6 bytes are a MAC */
-               proto_tree_add_item(edp_tree, hf_edp_midtype, tvb, offset, 2,
-                       ENC_BIG_ENDIAN);
-               offset += 2;
+       /* Machine ID is 8 bytes, if it starts with 0000, the remaining
+          6 bytes are a MAC */
+       proto_tree_add_item(edp_tree, hf_edp_midtype, tvb, offset, 2,
+                           ENC_BIG_ENDIAN);
+       offset += 2;
 
-               proto_tree_add_item(edp_tree, hf_edp_midmac, tvb, offset, 6,
-                       ENC_NA);
-               offset += 6;
-
-               /* Decode the individual TLVs */
-               while (offset < data_length && !last) {
-                       if (data_length - offset < 4) {
-                               proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 4,
-                                                               "Too few bytes left for TLV: %u (< 4)",
-                               data_length - offset);
-                               break;
-                       }
-                       tlv_type = tvb_get_guint8(tvb, offset + 1);
-                       tlv_length = tvb_get_ntohs(tvb, offset + 2);
-
-                       if ((tlv_length < 4) || (tlv_length > (data_length - offset))) {
-                               proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 0,
-                                                               "TLV with invalid length: %u", tlv_length);
-                               break;
-                       }
-                       if (tlv_type != EDP_TYPE_NULL)
-                               col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
-                                       val_to_str(tlv_type, edp_type_vals, "[0x%02x]"));
+       proto_tree_add_item(edp_tree, hf_edp_midmac, tvb, offset, 6,
+                           ENC_NA);
+       offset += 6;
 
-                       switch (tlv_type) {
-                       case EDP_TYPE_NULL: /* Last TLV */
-                               dissect_null_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               last = 1;
-                               break;
-                       case EDP_TYPE_DISPLAY: /* MIB II display string */
-                               dissect_display_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       case EDP_TYPE_INFO: /* Basic system information */
-                               dissect_info_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       case EDP_TYPE_VLAN: /* VLAN info */
-                               dissect_vlan_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       case EDP_TYPE_ESRP: /* Extreme Standby Router Protocol */
-                               dissect_esrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       case EDP_TYPE_EAPS: /* Ethernet Automatic Protection Swtiching */
-                               dissect_eaps_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       case EDP_TYPE_ESL: /* EAPS shared link */
-                               dissect_esl_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       case EDP_TYPE_ELSM: /* Extreme Link Status Monitoring */
-                               dissect_elsm_tlv(tvb, pinfo, offset, tlv_length, edp_tree, seqno);
-                               break;
-                       case EDP_TYPE_ELRP: /* Extreme Loop Recognition Protocol */
-                               dissect_elrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       default:
-                               dissect_unknown_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
-                               break;
-                       }
-                       offset += tlv_length;
+       /* Decode the individual TLVs */
+       while (offset < data_length && !last) {
+               if (data_length - offset < 4) {
+                       proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 4,
+                                                    "Too few bytes left for TLV: %u (< 4)",
+                                                    data_length - offset);
+                       break;
                }
+               tlv_type = tvb_get_guint8(tvb, offset + 1);
+               tlv_length = tvb_get_ntohs(tvb, offset + 2);
 
+               if ((tlv_length < 4) || (tlv_length > (data_length - offset))) {
+                       proto_tree_add_expert_format(edp_tree, pinfo, &ei_edp_short_tlv, tvb, offset, 0,
+                                                    "TLV with invalid length: %u", tlv_length);
+                       break;
+               }
+               if (tlv_type != EDP_TYPE_NULL)
+                       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
+                                       val_to_str(tlv_type, edp_type_vals, "[0x%02x]"));
+
+               switch (tlv_type) {
+               case EDP_TYPE_NULL: /* Last TLV */
+                       dissect_null_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       last = 1;
+                       break;
+               case EDP_TYPE_DISPLAY: /* MIB II display string */
+                       dissect_display_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               case EDP_TYPE_INFO: /* Basic system information */
+                       dissect_info_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               case EDP_TYPE_VLAN: /* VLAN info */
+                       dissect_vlan_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               case EDP_TYPE_ESRP: /* Extreme Standby Router Protocol */
+                       dissect_esrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               case EDP_TYPE_EAPS: /* Ethernet Automatic Protection Swtiching */
+                       dissect_eaps_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               case EDP_TYPE_ESL: /* EAPS shared link */
+                       dissect_esl_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               case EDP_TYPE_ELSM: /* Extreme Link Status Monitoring */
+                       dissect_elsm_tlv(tvb, pinfo, offset, tlv_length, edp_tree, seqno);
+                       break;
+               case EDP_TYPE_ELRP: /* Extreme Loop Recognition Protocol */
+                       dissect_elrp_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               default:
+                       dissect_unknown_tlv(tvb, pinfo, offset, tlv_length, edp_tree);
+                       break;
+               }
+               offset += tlv_length;
        }
+
 }
 
 void
index c23cb9a6326d2a1d53a0c5030a596cdf63af1434..9e3d52a15a72d38b4d59b7261356177bd9061ad0 100644 (file)
@@ -318,10 +318,8 @@ static void dissect_ismacryp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tre
        } /* end if user_mode == FALSE */
 
        /* navigate through buffer */
-       if (tree)
+       /* if (tree) */
        {
-               /* we are being asked for details */
-
                guint16 au_headers_length = 0; /* total length of AU headers */
                guint16 totalbits =0;          /* keeps track of total number of AU header bits treated (used to determine end of AU headers) */
                int deltabits = -1;            /* keeps track of extra bits per AU header treated (used to determine end of AU heafers ) */
index c107c973d184d4c833e80acd60ce368190a44a4e..e3467752893a3f39e4374f2322e606e76ee71296 100644 (file)
@@ -90,7 +90,7 @@ static void dissect_kdp(tvbuff_t *tvb,
 
   col_set_str(pinfo->cinfo, COL_PROTOCOL, "KDP");
   col_clear(pinfo->cinfo, COL_INFO);
-  if (tree) {
+  /* if (tree) */ {
     proto_item *ti;
     proto_tree *kdp_tree, *flags_tree;
     ti = NULL;
index f174ef1142cc46834d6d1d04ed142adc289ac806..5db09425968903ad05618fc98607c23336ff4be0 100644 (file)
@@ -145,187 +145,187 @@ dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "LACP");
     col_set_str(pinfo->cinfo, COL_INFO, "Link Aggregation Control Protocol");
 
-    if (tree)
-    {
-        /* Add LACP Heading */
-        lacpdu_item = proto_tree_add_protocol_format(tree, proto_lacp, tvb,
-                0, -1, "Link Aggregation Control Protocol");
-        lacpdu_tree = proto_item_add_subtree(lacpdu_item, ett_lacp);
+    /* Add LACP Heading */
+    lacpdu_item = proto_tree_add_protocol_format(tree, proto_lacp, tvb,
+                                                 0, -1, "Link Aggregation Control Protocol");
+    lacpdu_tree = proto_item_add_subtree(lacpdu_item, ett_lacp);
 
-        /* Version Number */
+    /* Version Number */
 
-        raw_octet = tvb_get_guint8(tvb, offset);
-        col_append_fstr(pinfo->cinfo, COL_INFO, "Version %d.  ", raw_octet);
-        proto_tree_add_uint(lacpdu_tree, hf_lacp_version_number, tvb,
-                offset, 1, raw_octet);
-        offset += 1;
+    raw_octet = tvb_get_guint8(tvb, offset);
+    col_append_fstr(pinfo->cinfo, COL_INFO, "Version %d.  ", raw_octet);
+    proto_tree_add_uint(lacpdu_tree, hf_lacp_version_number, tvb,
+                        offset, 1, raw_octet);
+    offset += 1;
 
-        /* Actor Type */
+    /* Actor Type */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_type, tvb,
-                offset, 1, ENC_BIG_ENDIAN);
-        offset += 1;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_type, tvb,
+                        offset, 1, ENC_BIG_ENDIAN);
+    offset += 1;
 
-        /* Actor Info Length */
+    /* Actor Info Length */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_info_len, tvb,
-                offset, 1, ENC_BIG_ENDIAN);
-        offset += 1;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_info_len, tvb,
+                        offset, 1, ENC_BIG_ENDIAN);
+    offset += 1;
 
-        /* Actor System Priority */
+    /* Actor System Priority */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys_priority, tvb,
-                offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys_priority, tvb,
+                        offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        /* Actor System */
+    /* Actor System */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys, tvb,
-                offset, 6, ENC_NA);
-        offset += 6;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_sys, tvb,
+                        offset, 6, ENC_NA);
+    offset += 6;
 
-        /* Actor Key */
+    /* Actor Key */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_key, tvb,
-                offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_key, tvb,
+                        offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        /* Actor Port Priority */
+    /* Actor Port Priority */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_port_priority, tvb,
-                offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_port_priority, tvb,
+                        offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        /* Actor Port */
+    /* Actor Port */
 
-        raw_word = tvb_get_ntohs(tvb, offset);
-        col_append_fstr(pinfo->cinfo, COL_INFO, "Actor Port = %d ", raw_word);
-        proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_port, tvb,
-                offset, 2, raw_word);
-        offset += 2;
+    raw_word = tvb_get_ntohs(tvb, offset);
+    col_append_fstr(pinfo->cinfo, COL_INFO, "Actor Port = %d ", raw_word);
+    proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_port, tvb,
+                        offset, 2, raw_word);
+    offset += 2;
 
-        /* Actor State */
+    /* Actor State */
 
-        flags = tvb_get_guint8(tvb, offset);
-        actor_flags_item = proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_state, tvb,
-                offset, 1, flags);
-        actor_flags_tree = proto_item_add_subtree(actor_flags_item, ett_lacp_a_flags);
+    flags = tvb_get_guint8(tvb, offset);
+    actor_flags_item = proto_tree_add_uint(lacpdu_tree, hf_lacp_actor_state, tvb,
+                                           offset, 1, flags);
+    actor_flags_tree = proto_item_add_subtree(actor_flags_item, ett_lacp_a_flags);
 
-        sep = initial_sep;
+    sep = initial_sep;
 
-        /* Activity Flag */
+    /* Activity Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_ACTIVITY, actor_flags_item,
-                "%sActivity");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_activity, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_ACTIVITY, actor_flags_item,
+                        "%sActivity");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_activity, tvb,
+                           offset, 1, flags);
 
-        /* Timeout Flag */
+    /* Timeout Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_TIMEOUT, actor_flags_item,
-                "%sTimeout");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_timeout, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_TIMEOUT, actor_flags_item,
+                        "%sTimeout");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_timeout, tvb,
+                           offset, 1, flags);
 
-        /* Aggregation Flag */
+    /* Aggregation Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_AGGREGATION, actor_flags_item,
-                "%sAggregation");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_aggregation, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_AGGREGATION, actor_flags_item,
+                        "%sAggregation");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_aggregation, tvb,
+                           offset, 1, flags);
 
-        /* Synchronization Flag */
+    /* Synchronization Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_SYNC, actor_flags_item,
-                "%sSynchronization");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_sync, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_SYNC, actor_flags_item,
+                        "%sSynchronization");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_sync, tvb,
+                           offset, 1, flags);
 
-        /* Collecting Flag */
+    /* Collecting Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_COLLECTING, actor_flags_item,
-                "%sCollecting");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_collecting, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_COLLECTING, actor_flags_item,
+                        "%sCollecting");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_collecting, tvb,
+                           offset, 1, flags);
 
-        /* Distributing Flag */
+    /* Distributing Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DISTRIB, actor_flags_item,
-                "%sDistributing");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_distrib, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DISTRIB, actor_flags_item,
+                        "%sDistributing");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_distrib, tvb,
+                           offset, 1, flags);
 
-        /* Defaulted Flag */
+    /* Defaulted Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DEFAULTED, actor_flags_item,
-                "%sDefaulted");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_defaulted, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_DEFAULTED, actor_flags_item,
+                        "%sDefaulted");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_defaulted, tvb,
+                           offset, 1, flags);
 
-        /* Expired Flag */
+    /* Expired Flag */
 
-        APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_EXPIRED, actor_flags_item,
-                "%sExpired");
-        proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_expired, tvb,
-                offset, 1, flags);
+    APPEND_BOOLEAN_FLAG(flags & LACPDU_FLAGS_EXPIRED, actor_flags_item,
+                        "%sExpired");
+    proto_tree_add_boolean(actor_flags_tree, hf_lacp_flags_a_expired, tvb,
+                           offset, 1, flags);
 
-        if (sep != initial_sep)
-        {
-            /* We put something in; put in the terminating ")" */
-            proto_item_append_text(actor_flags_item, ")");
-        }
-        offset += 1;
+    if (sep != initial_sep)
+    {
+        /* We put something in; put in the terminating ")" */
+        proto_item_append_text(actor_flags_item, ")");
+    }
+    offset += 1;
 
-        /* Actor Reserved */
+    /* Actor Reserved */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_actor_reserved, tvb,
-                offset, 3, ENC_NA);
-        offset += 3;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_actor_reserved, tvb,
+                        offset, 3, ENC_NA);
+    offset += 3;
 
-        /* Partner Type */
+    /* Partner Type */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_partner_type, tvb,
-                offset, 1, ENC_BIG_ENDIAN);
-        offset += 1;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_partner_type, tvb,
+                        offset, 1, ENC_BIG_ENDIAN);
+    offset += 1;
 
-        /* Partner Info Length */
+    /* Partner Info Length */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_partner_info_len, tvb,
-                offset, 1, ENC_BIG_ENDIAN);
-        offset += 1;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_partner_info_len, tvb,
+                        offset, 1, ENC_BIG_ENDIAN);
+    offset += 1;
 
-        /* Partner System Priority */
+    /* Partner System Priority */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys_priority, tvb,
-                offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys_priority, tvb,
+                        offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        /* Partner System */
+    /* Partner System */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys, tvb,
-                offset, 6, ENC_NA);
-        offset += 6;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_partner_sys, tvb,
+                        offset, 6, ENC_NA);
+    offset += 6;
 
-        /* Partner Key */
+    /* Partner Key */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_partner_key, tvb,
-                offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_partner_key, tvb,
+                        offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        /* Partner Port Priority */
+    /* Partner Port Priority */
 
-        proto_tree_add_item(lacpdu_tree, hf_lacp_partner_port_priority, tvb,
-                offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(lacpdu_tree, hf_lacp_partner_port_priority, tvb,
+                        offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        /* Partner Port */
+    /* Partner Port */
 
-        raw_word = tvb_get_ntohs(tvb, offset);
-        col_append_fstr(pinfo->cinfo, COL_INFO, "Partner Port = %d ", raw_word);
-        proto_tree_add_uint(lacpdu_tree, hf_lacp_partner_port, tvb,
-                offset, 2, raw_word);
-        offset += 2;
+    raw_word = tvb_get_ntohs(tvb, offset);
+    col_append_fstr(pinfo->cinfo, COL_INFO, "Partner Port = %d ", raw_word);
+    proto_tree_add_uint(lacpdu_tree, hf_lacp_partner_port, tvb,
+                        offset, 2, raw_word);
+    offset += 2;
 
+    if (tree)
+    {
         /* Partner State */
 
         flags = tvb_get_guint8(tvb, offset);
index abf65179cc9d4b9d5b3b7ee9459d9a292aca12d7..cc6a913d5e5e88c108b99284ef14afe0b6ad0f95 100644 (file)
@@ -1039,7 +1039,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
        mi->is_duplicate = FALSE;
        mi->request_available = FALSE;
 
-       if (tree)
+       /* if (tree) */
        {
                tokennum = 0;
 
index 3b25058b26f84d83b6aabd4071071c0f5aa2e7d1..68f8a3a8885cf37220d98006b27c2b6e14e025fc 100644 (file)
@@ -2075,14 +2075,12 @@ dissect_netflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
     offset += 2;
 
     pdus = tvb_get_ntohs(tvb, offset);
-    if (tree) {
-        if(ver == 10) {
-            proto_tree_add_uint(netflow_tree, hf_cflow_len, tvb, offset, 2, pdus);
-            flow_len = pdus;
-        } else {
-            proto_tree_add_uint(netflow_tree, hf_cflow_count, tvb, offset, 2, pdus);
-            flow_len = -1;
-        }
+    if(ver == 10) {
+        proto_tree_add_uint(netflow_tree, hf_cflow_len, tvb, offset, 2, pdus);
+        flow_len = pdus;
+    } else {
+        proto_tree_add_uint(netflow_tree, hf_cflow_count, tvb, offset, 2, pdus);
+        flow_len = -1;
     }
     offset += 2;
 
index fb6025bf38ea96d718ee768498e3b237185026d6..0c52accb20207899f95c8190f18a553416acc441 100644 (file)
@@ -85,7 +85,7 @@ dissect_tivoconnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
 
     col_set_str(pinfo->cinfo, COL_INFO, proto_name);
 
-    if (tree) {
+    /* if (tree) */ {
         /* Set up structures needed to add the protocol subtree and manage it */
         proto_item *ti = NULL;
         proto_tree *tivoconnect_tree = NULL;
index 9901161ee2f8f0eeebee48d08bdf821e78fff227..c5ad1a7bcd3237887c20cb76e67ce136d93219bb 100644 (file)
@@ -2001,8 +2001,7 @@ dissect_v52_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     }
 
 
-    if (v52_tree != NULL) {
-
+    /* if (v52_tree != NULL) */ {
 
         message_type_tmp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET);