diff options
author | yongari <yongari@FreeBSD.org> | 2014-05-13 05:07:03 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2014-05-13 05:07:03 +0000 |
commit | 40228299cdc612bcab2f1c078085e4e88700fae4 (patch) | |
tree | b52fda44d568633b19f4341a28a72cb5c23d29f4 /sys/netinet/ip_input.c | |
parent | c0a09660e6c774d4d5b87158fd7e68b0b27d2893 (diff) | |
download | FreeBSD-src-40228299cdc612bcab2f1c078085e4e88700fae4.zip FreeBSD-src-40228299cdc612bcab2f1c078085e4e88700fae4.tar.gz |
Fix checksum computation. Previously it didn't include carry.
Reviewed by: tuexen
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index e460f8d..3a24296 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1080,8 +1080,9 @@ found: * (and not in for{} loop), though it implies we are not going to * reassemble more than 64k fragments. */ - m->m_pkthdr.csum_data = - (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + while (m->m_pkthdr.csum_data & 0xffff0000) + m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + + (m->m_pkthdr.csum_data >> 16); #ifdef MAC mac_ipq_reassemble(fp, m); mac_ipq_destroy(fp); |