diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 2250116c6ed..00667a529cb 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -988,6 +988,13 @@ found: m->m_pkthdr.csum_data += q->m_pkthdr.csum_data; m_cat(m, q); } + /* + * In order to do checksumming faster we do 'end-around carry' here + * (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); #ifdef MAC mac_create_datagram_from_ipq(fp, m); mac_destroy_ipq(fp);