On Tue, Mar 14, 2006 at 02:32:01PM -0600, Kris Katterjohn wrote:
The attached patch removes a useless assignment to a variable.
--- tcpip.cc.orig 2006-03-08 15:29:54.000000000 -0600
+++ tcpip.cc 2006-03-14 12:36:09.000000000 -0600
@@ -1179,7 +1179,6 @@ char *ping = (char *) &pingpkt;
pingpkt.code = 0;
pingpkt.id = id;
pingpkt.seq = seq;
-pingpkt.checksum = 0;
pingpkt.checksum = in_cksum((unsigned short *)ping, icmplen);
This is actually necessary. Since 'char *ping' points to pingpkt the
checksum has to be zero before calculating it. See RFC 791 or 792
(I think both have identical texts, or 792 references 791) for details.
It doesn't matter if pingpkt is in the bss but relying on such
things will cause hard-to-find bugs when bitrot strikes (nmap will
look like it's working, but some devices may refuse to respond when
the checksum is bogus).