Subject: Re: A question about the IP header checksum
To: None <tech-net@NetBSD.org>
From: John Nemeth <jnemeth@victoria.tc.ca>
List: tech-net
Date: 12/05/2007 16:19:06
On Apr 27,  6:42pm, Alan Barrett wrote:
} On Wed, 05 Dec 2007, John Nemeth wrote:
} > }     Is it proper to substitute a resulting value of 0x0000 with 0xffff as 
} > }     is done in UDP?
} > 
} >      No.  This question could easily be answered by checking the RFC
} > for IP (it is fairly easy to read).  See
} > ftp://ftp.rfc-editor.org/in-notes/rfc791.txt .
} 
} RFC 791 simply refers to one's complement arithmetic without defining
} it.  In one's complement arithmetic, both 0x0000 and 0xffff represent
} zero, so I'd say that they are interchangeable, in the absence of extra
} text in RFC 791 saying that they are not interchangeable.

     Are you suggesting that if you perform the math and the result is
either 0x0000 of 0xffff that you need to check the header for both,
instead of doing a simple comparison?

}-- End of excerpt from Alan Barrett