Ethereal-cvs: [ethereal-cvs] cvs commit: ethereal packet-ip.c

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 4 Aug 2000 17:43:52 -0500 (CDT)
guy         2000/08/04 17:43:50 CDT

  Modified files:
    .                    packet-ip.c 
  Log:
  Clean up the checksumming stuff a bit:
  
  	have "ip_checksum()" compute the checksum of the IP header;
  
  	have "ip_checksum_state()" call "ip_checksum()" and then return
  	TRUE if the result is 0 and FALSE otherwise;
  
  	have "ip_checksum_shouldbe()" save the current value of the
  	checksum field in the header, set that field to 0, call
  	"ip_checksum()" to get the checksum, restore the value of the
  	checksum field in the header to the saved value, and then return
  	what "ip_checksum()" returned;
  
  rather than having duplicated code to compute checksums.
  
  Revision  Changes    Path
  1.97      +29 -27    ethereal/packet-ip.c