Subject: Re: A question about the IP header checksum
To: None <tech-net@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-net
Date: 12/06/2007 00:00:54
On Wed, 05 Dec 2007, patrick@klos.com wrote:
> The IP header checksum is pretty straightforward: add up all the (2 byte)
> words in the IP header using one's complement addition, then take the one's
> complement of the sum and insert that as the checksum.  Here's the question:
> 
>     Is it proper to substitute a resulting value of 0x0000 with 0xffff as 
>     is done in UDP?

Yes, 0x0000 and 0xffff are interchangeable in IP and TCP checksums,
though 0x0000 is special in UDP checksums.

--apb (Alan Barrett)