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:
tuexen 2015-05-31 12:11:05 +00:00
parent 7b87a7e6ff
commit e5205dfbe6

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