A TCP checksum of 0 is completely valid. Mapping 0 to 0xffff only

applies to UDP and UDP-Lite.

MFC after: 3 days
This commit is contained in:
Michael Tuexen 2015-05-31 12:11:05 +00:00
parent 7fc593dd82
commit 0239602b83
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283819

View File

@ -1470,10 +1470,8 @@ tcp_prep(struct outdata *outdata)
tcp->th_flags = TH_SYN;
tcp->th_sum = 0;
if (doipcksum) {
u_short sum = p_cksum(outip, (u_short*)tcp, protlen, protlen);
tcp->th_sum = (sum) ? sum : 0xffff;
}
if (doipcksum)
tcp->th_sum = p_cksum(outip, (u_short*)tcp, protlen, protlen);
}
int