Properly preserve ip_tos bits for IPv4 packets
authorlidl <lidl@FreeBSD.org>
Thu, 29 Sep 2016 19:45:24 +0000 (19:45 +0000)
committerlidl <lidl@FreeBSD.org>
Thu, 29 Sep 2016 19:45:24 +0000 (19:45 +0000)
commitafb49c8e8c0eb95dad79553c9cb26b6cbfdb8923
tree9952f16e2cda35c50fcfb5ec15b92d46e8e3dd99
parent8443fee657f887e5c703cf81112924a3ea8476af
Properly preserve ip_tos bits for IPv4 packets

Restructure code slightly to save ip_tos bits earlier.  Fix the bug
where the ip_tos field is zeroed out before assigning to the iptos
variable. Restore the ip_tos and ip_ver fields only if they have
been zeroed during the pseudo-header checksum calculation.

Reviewed by: cem, gnn, hiren
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8053
sys/netinet/tcp_input.c