diff options
author | Michael Mann <mmann78@netscape.net> | 2017-03-20 10:24:37 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-03-20 15:43:58 +0000 |
commit | 45b8a1e7ea18d62f78aa6f7812d91a576811ae72 (patch) | |
tree | b7dca515a9c8f230d46ef2918334411753bb2988 /epan/dissectors/packet-mip6.c | |
parent | e6525ab178265eba9a937675df03a4643b8a5a9b (diff) |
MIPv6: Bugfix proto_tree_add_item_ret_uint usage.
hf_mip6_ipv4ha_ha field is an FT_IPv4 type, so proto_tree_add_item_ret_uint can't be used.
Also correct option tree display noticed while debugging above issue.
Bug: 13499
Change-Id: I6da281567f47d08864575e41fa2a29347d55613a
Reviewed-on: https://code.wireshark.org/review/20646
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-mip6.c')
-rw-r--r-- | epan/dissectors/packet-mip6.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c index d5a2fa1be2..bd6b6dde02 100644 --- a/epan/dissectors/packet-mip6.c +++ b/epan/dissectors/packet-mip6.c @@ -3008,8 +3008,10 @@ dissect_pmip6_opt_ipv4hareq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item(opt_tree, hf_mip6_ipv4ha_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - item = proto_tree_add_item_ret_uint(opt_tree, hf_mip6_ipv4ha_ha, tvb, - offset, MIP6_IPV4HAREQ_HA_LEN, ENC_BIG_ENDIAN, &dword); + /* Field is an IPv4 address, so can't be retrieved by proto_tree_add_item_ret_uint */ + dword = tvb_get_ntohl(tvb,offset); + item = proto_tree_add_item(opt_tree, hf_mip6_ipv4ha_ha, tvb, + offset, MIP6_IPV4HAREQ_HA_LEN, ENC_BIG_ENDIAN); if (dword == 0) { proto_item_append_text(item, " - Request that the local mobility anchor perform the address allocation"); } @@ -3669,6 +3671,7 @@ dissect_mipv6_options(tvbuff_t *tvb, int offset, guint length, dissector_handle_t option_dissector; tvbuff_t *next_tvb; proto_item *ti; + proto_tree *unknown_tree; while ((gint)length > 0) { opt = tvb_get_guint8(tvb, offset); @@ -3710,11 +3713,10 @@ dissect_mipv6_options(tvbuff_t *tvb, int offset, guint length, return; } - option_dissector = dissector_get_uint_handle(mip6_option_table, opt); if (option_dissector == NULL) { - opt_tree = proto_tree_add_subtree(opt_tree, tvb, offset, len+2, ett_mip6_opt_unknown, &ti, name); - proto_tree_add_item(opt_tree, hf_mip6_mobility_opt, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_item(opt_tree, hf_mip6_opt_len, tvb, 1, 1, ENC_NA); + unknown_tree = proto_tree_add_subtree(opt_tree, tvb, offset, len+2, ett_mip6_opt_unknown, &ti, name); + proto_tree_add_item(unknown_tree, hf_mip6_mobility_opt, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(unknown_tree, hf_mip6_opt_len, tvb, 1, 1, ENC_NA); expert_add_info(pinfo, ti, &ei_mip6_ie_not_dissected); } else { |