diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-05-03 21:11:04 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-05-06 17:12:28 +0000 |
commit | abdfd884925baece610b156e1efa7341349c4d50 (patch) | |
tree | 4ae282579b3a0af96b2c4a4d291033c9e49d0df6 /epan/dissectors/packet-pim.c | |
parent | 1e3be59fbe19416d9c84495e4e7bc1c95b1cf9f2 (diff) |
PIM: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ia8eca42bae42fb139bfc63232c6d9bf05811ad39
Reviewed-on: https://code.wireshark.org/review/8280
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-pim.c')
-rw-r--r-- | epan/dissectors/packet-pim.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c index 9c289a5fe2..09ca20e77e 100644 --- a/epan/dissectors/packet-pim.c +++ b/epan/dissectors/packet-pim.c @@ -136,6 +136,7 @@ static int hf_pim_df_elect_rsvd = -1; static int hf_pim_cksum = -1; static int hf_pim_res_bytes = -1; /* PIM Hello options (RFC 4601, section 4.9.2 and RFC 3973, section 4.7.5) */ +static int hf_pim_option = -1; static int hf_pim_optiontype = -1; static int hf_pim_optionlength = -1; static int hf_pim_optionvalue = -1; @@ -405,7 +406,9 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U offset += 3; /* skip reserved stuff */ if (tvb_reported_length_remaining(tvb, offset) > 0) { - pimopt_tree = proto_tree_add_subtree(pim_tree, tvb, offset, -1, ett_pim_opts, NULL, "PIM options"); + proto_item *subitem; + subitem = proto_tree_add_item(pim_tree, hf_pim_option, tvb, offset, -1, ENC_NA); + pimopt_tree = proto_item_add_subtree(subitem, ett_pim_opts); } else return offset; @@ -839,7 +842,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_uint(pim_tree, hf_pim_cksum, tvb, offset + 2, 2, pim_cksum); if (tvb_reported_length_remaining(tvb, offset) > 0) { - pimopt_tree = proto_tree_add_subtree(pim_tree, tvb, offset, -1, ett_pim_opts, &tiopt, "PIM options"); + proto_tree_add_item(pim_tree, hf_pim_option, tvb, offset, -1, ENC_NA); } goto done; } @@ -912,7 +915,8 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { offset += 4; if (tvb_reported_length_remaining(tvb, offset) > 0) { - pimopt_tree = proto_tree_add_subtree(pim_tree, tvb, offset, -1, ett_pim_opts, &tiopt, "PIM options"); + tiopt = proto_tree_add_item(pim_tree, hf_pim_option, tvb, offset, -1, ENC_NA); + pimopt_tree = proto_item_add_subtree(tiopt, ett_pim_opts); } else goto done; @@ -1428,6 +1432,11 @@ proto_register_pim(void) FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_pim_option, + { "PIM Options", "pim.option", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_pim_optiontype, { "Type", "pim.optiontype", FT_UINT16, BASE_DEC, NULL, 0x0, |