aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-12-11 01:24:45 +0000
committerAnders Broman <a.broman58@gmail.com>2015-12-11 06:59:30 +0000
commit00eb71ac32e2736c85147ad5addf7ceed1e20db6 (patch)
treef589534820f1d84b0bfb11ef75b1dbc5ee4c5a10 /epan
parente8b8568b7c5d0035a13b6f0dd93a5406ffff0b13 (diff)
MIPv6: Fix unknown MH Type message data length
Also improve column info for unknown MH types. Ping-Bug: 11728 Change-Id: I4e54ae56dbb76eaf9ea4f33eb0ff497a518dbd9a Reviewed-on: https://code.wireshark.org/review/12513 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-mip6.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c
index a3c2466f95..4a2f9b032f 100644
--- a/epan/dissectors/packet-mip6.c
+++ b/epan/dissectors/packet-mip6.c
@@ -1137,7 +1137,7 @@ static int hf_mip6_bi_coa_ipv4 = -1;
static int hf_mip6_bi_coa_ipv6 = -1;
static int hf_mip6_binding_refresh_request = -1;
-static int hf_mip6_unknown_mh_type = -1;
+static int hf_mip6_unknown_type_data = -1;
static int hf_mip6_fast_neighbor_advertisement = -1;
static int hf_mip6_vsm_data = -1;
static int hf_mip6_vsm_req_data = -1;
@@ -1595,9 +1595,14 @@ dissect_mip6_hack(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo _U_)
static int
dissect_mip6_unknown(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo _U_)
{
- proto_tree_add_item(mip6_tree, hf_mip6_unknown_mh_type, tvb, MIP6_DATA_OFF, MIP6_DATA_OFF + 1, ENC_NA);
+ guint hdr_len, data_len;
- return MIP6_DATA_OFF + 1;
+ hdr_len = (tvb_get_guint8(tvb, MIP6_HLEN_OFF) + 1) * 8;
+ data_len = hdr_len - MIP6_DATA_OFF;
+
+ proto_tree_add_item(mip6_tree, hf_mip6_unknown_type_data, tvb, MIP6_DATA_OFF, data_len, ENC_NA);
+
+ return hdr_len;
}
static int
@@ -4041,7 +4046,7 @@ dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* Process mobility header */
type = tvb_get_guint8(tvb, MIP6_TYPE_OFF);
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext_const(type, &mip6_mh_types_ext, "<unknown>"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(type, &mip6_mh_types_ext, "Unknown Mobility Header (%u)"));
switch (type) {
case MIP6_BRR:
/* 0 Binding Refresh Request */
@@ -4132,8 +4137,7 @@ dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
offset = dissect_pmip6_lra(tvb, mip6_tree, pinfo, offset);
break;
default:
- dissect_mip6_unknown(tvb, mip6_tree, pinfo);
- offset = len;
+ offset = dissect_mip6_unknown(tvb, mip6_tree, pinfo);
break;
}
@@ -4849,8 +4853,8 @@ proto_register_mip6(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
- { &hf_mip6_unknown_mh_type,
- { "Unknown MH Type", "mip6.unknown_mh_type",
+ { &hf_mip6_unknown_type_data,
+ { "Message Data", "mip6.unknown_type_data",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},