Wireshark-bugs: [Wireshark-bugs] [Bug 5476] ICMPv6 Enhancements : make ICMP option filterable (P

Date: Fri, 10 Dec 2010 07:59:28 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5476

--- Comment #5 from Alexis La Goutte <alexis.lagoutte@xxxxxxxxx> 2010-12-10 07:59:28 PST ---
(In reply to comment #4)
> 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?
Oups !
Yes, it's missing a case 8 (with not specific action..)
> Shouldn't  
> tvb_memcpy(tvb, (guint8 *)&prefix, opt_offset, 8);
> Be
> tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8);
> 
i don't known but the old code use 
        case 3:
        tvb_memcpy(tvb, (guint8 *)&in6, offset + sizeof(*ri), l = 16);
        break;


> >Also, the copy for section RFC is needed ?
> Well I'd like it to be there...
no problem ! keep :)

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.