Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Oct 2005 13:19:20 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        kamal kc <kamal_ckk@yahoo.com>
Cc:        freebsd <freebsd-net@freebsd.org>, freebsd <freebsd-hackers@freebsd.org>
Subject:   Re: in_cksum() for ip packets with multiple mbufs
Message-ID:  <20051023101919.GA9957@flame.pc>
In-Reply-To: <20051023083015.18292.qmail@web35705.mail.mud.yahoo.com>
References:  <20051023083015.18292.qmail@web35705.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-10-23 01:30, kamal kc <kamal_ckk@yahoo.com> wrote:
> i come across this unusual problem.
>
> i changed the ip_tos field of the struct ip and computed the checksum
> by using in_cksum().
>
> when the packet uses only one mbuf the computed checksum is ok but
> when the packet uses more than one mbuf then the computed checksum is
> wrong.

Note that the IP header contains a checksum of the IP header only.

A common mistake is to calculate the checksum of data too, which results
in an invalid IP header checksum.

> eg. pinging with payload less than 1470 bytes is ok but with payload
> greater than 1480 bytes does not work. (the error being bad checksum
> --that i knew by capturing network packets by ethereal)
>
> is it a real problem or i have made some mistake.
>
> i put the code before the if_output() in the ip_output() function.

Show us the diff, if possible :)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051023101919.GA9957>