Ethereal-dev: Re: [Ethereal-dev] [Bug Report] IPv6 PIM checksum

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 30 Oct 2001 02:13:48 -0800
On Tue, Oct 30, 2001 at 02:03:09PM +0900, SUZUKI Shinsuke wrote:
> Here's a report and patch for ethereal's IPv6 PIM checksum calculation bug.
> Could you please review this report and merge this patch into ethereal?

	...

> In packet_pim.c, ethereal calculates PIM checksum using just PIM message.
> However in case of IPv6, IPv6 pseudo-header should also be used in its
> calculation. (see draft-ietf-pim-sm-v2-new-03.txt Page.99)

THANK YOU!

The checksumming code I checked a while ago in matched the way I
understood what RFC 2362 was saying:

        Checksum
             The checksum is the 16-bit one's complement of the one's
             complement sum of the entire PIM message, (excluding the 
             data portion in the Register message).  For computing the
             checksum, the checksum field is zeroed.

but it was getting the wrong answer when checksumming PIM-over-IPv6
packets; I couldn't figure it out, because I didn't know the draft had
added the stuff about using the IPv6 pseudo-header in the calculation.

> Here's the patch for this issue.

Checked in, with one change:

> --- packet-pim.c	Sat Jul 21 19:27:13 2001
> +++ packet-pim.c.new	Tue Oct 30 13:43:34 2001
> @@ -613,6 +613,7 @@
>      guint length, pim_length;
>      guint16 pim_cksum, computed_cksum;
>      vec_t cksum_vec[1];

If you're going to fill in four items in an array, the array should be 4
elements long - I expanded "cksum_vec" to have 4 elements.