freebsd/freebsd — pull request #12 by Seb-LineRate (2014-10-29 21:27:07+00:00)
Title: don't zero the IP TOS bits on mbufs that need checksumming

On mbufs that don't have the CSUM_DATA_VALID flag set, tcp_input()
needs to compute the TCP checksum itself.

The TCP checksum includes some but not all fields from the IP header.

tcp_input() zeroes the fields of the IP header that are not to be
included in the checksum, then checksums the entire packet (IP
header, TCP header, and TCP data), then restores the IP header
fields it will need later.

The bug that this commit fixes is that the IP TOS field was not
restored, so the later read of it returned a zeroed byte instead
of the incoming packet's actual TOS value.