The length of TCP to CRC is certain, if the length of the checksum is outside the range? How is it true?
Ushort Checksum (Ushort * Buffer, int size)
{
UNSIGNEDLONG = 0;
While (size> 1)
{
CKSUM = * Buffer ;
Size - = SizeOf (Ushort);
}
IF (size)
{
CKSUM = * (Uchar *) BUFFER;
}
Cksum = (CKSUM >> 16) (CKSUM & 0xFFF);
Cksum = (CKSUM >> 16);
Return (Ushort) (~ CKSUM);
}
In the TCP / IP, IP, IP, in Chapter 3, there is a paragraph: "First set the inspection and field to 0. Then, the secondary reflex code for each 16bit in the first part (the entire first meeting is made by one The word 16bit is composed, the results exist in the inspection and fields. After receiving an IP datagram, the first 16bit for each 16bit is subjected to a binary inverse code.
Then, if any errors occur during the transmission process, the resulting result is 1, in the same, if the length is exceeded, that is, the same is 1