Wireshark-bugs: [Wireshark-bugs] [Bug 5476] ICMPv6 Enhancements : make ICMP option filterable (P
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5476
--- Comment #4 from Anders Broman <anders.broman@xxxxxxxxxxxx> 2010-12-10 06:54:03 PST ---
Hi,
I'm doubtful of this code:
switch(opt_len){
case 16:
memset(&prefix, 0, sizeof(prefix));
tvb_memcpy(tvb, (guint8 *)&prefix, opt_offset, 8);
proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix,
tvb, opt_offset, 8, prefix.bytes);
proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix),
prefix_len);
break;
case 24:
tvb_get_ipv6(tvb, opt_offset, &prefix);
proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_prefix,
tvb, opt_offset, 16, FALSE);
proto_item_append_text(ti, " %s/%d", ip6_to_str(&prefix),
prefix_len);
break;
default:
expert_add_info_format(pinfo, ti_opt_len, PI_MALFORMED,
PI_ERROR, "Invalid Option Length");
break;
}
Isn't the possible valid opt_lens 8, 16 and 24?
Shouldn't
tvb_memcpy(tvb, (guint8 *)&prefix, opt_offset, 8);
Be
tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8);
>Also, the copy for section RFC is needed ?
Well I'd like it to be there...
Regards
Anders
--
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.