MIPv6: Mobility Option IPv6 Address/Prefix marks too many bytes for the address/prefix field

One of the mobility options is the IPv6 Address/Prefix.
The prefix length of this option is 52.
Note that according to RFC 5568, the prefix length is in bits and not in bytes.
The IPv6 Address/Prefix field of this option marks 52 bytes.

In addition, I'm not sure that the IPv6 Address/Prefix field is a variable size field.
RFC 5568 section 6.4.2 has a diagram of this options that shows this field as if it always takes 128 bits, and the prefix length field just says the length of the prefix (not the length of the field).

Found by boaz

Bug:10576
Change-Id: I2a9a35cb7c537ec3b91c9a089f14fa31f41d8c80
Reviewed-on: https://code.wireshark.org/review/4816
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2014-10-18 16:31:01 +02:00 committed by Michael Mann
parent 8d6fd8dd23
commit 31c119fa78
1 changed files with 19 additions and 1 deletions

View File

@ -1084,6 +1084,8 @@ static int hf_mip6_opt_ipv4coa_addr = -1;
static int hf_pmip6_gre_key = -1;
static int hf_mip6_opt_mhipv6ap_opt_code = -1;
static int hf_mip6_opt_mhipv6ap_prefix_l = -1;
static int hf_mip6_opt_mhipv6ap_ipv6_address = -1;
static int hf_mip6_opt_mhipv6ap_ipv6_address_prefix = -1;
static int hf_mip6_ipv4dra_reserved = -1;
static int hf_mip6_ipv4dra_dra = -1;
@ -2609,6 +2611,7 @@ dissect_pmip6_opt_mhipv6ap(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset,
guint optlen _U_, packet_info *pinfo _U_, proto_tree *opt_tree, proto_item *hdr_item _U_ )
{
guint8 prefix_l;
proto_item *ti;
/* offset points to tag(opt) */
offset++;
@ -2617,10 +2620,15 @@ dissect_pmip6_opt_mhipv6ap(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset,
proto_tree_add_item(opt_tree, hf_mip6_opt_mhipv6ap_opt_code, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
prefix_l = tvb_get_guint8(tvb,offset);
proto_tree_add_item(opt_tree, hf_mip6_opt_mhipv6ap_prefix_l, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_text(opt_tree, tvb, offset, prefix_l, "IPv6 Address/Prefix");
proto_tree_add_item(opt_tree, hf_mip6_opt_mhipv6ap_ipv6_address, tvb, offset, 16, ENC_NA);
ti = proto_tree_add_string(opt_tree, hf_mip6_opt_mhipv6ap_ipv6_address_prefix, tvb, offset -1, 16+1, tvb_ip6_to_str(tvb, offset));
proto_item_append_text(ti, "/%u", prefix_l);
PROTO_ITEM_SET_GENERATED(ti);
}
/* 35 Binding Identifier [RFC5648] */
@ -4511,6 +4519,16 @@ proto_register_mip6(void)
FT_UINT8, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_mip6_opt_mhipv6ap_ipv6_address,
{ "IPv6 Address", "mip6.mhipv6ap.ipv6_address",
FT_IPv6, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_mip6_opt_mhipv6ap_ipv6_address_prefix,
{ "IPv6 Address/Prefix", "mip6.mhipv6ap.ipv6_address_prefix",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_mip6_opt_bi_bid,
{ "Binding ID (BID)", "mip6.bi.bid",
FT_UINT16, BASE_DEC, NULL, 0,