summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2014-05-13 05:07:03 +0000
committeryongari <yongari@FreeBSD.org>2014-05-13 05:07:03 +0000
commit40228299cdc612bcab2f1c078085e4e88700fae4 (patch)
treeb52fda44d568633b19f4341a28a72cb5c23d29f4 /sys/netinet/ip_input.c
parentc0a09660e6c774d4d5b87158fd7e68b0b27d2893 (diff)
downloadFreeBSD-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.c5
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);
OpenPOWER on IntegriCloud