FreeBSD/sys/dev/netmap/netmap_freebsd.c
/* Fold a raw checksum: 'cur_sum' is in host byte order, while the
 * return value is in network byte order.
 */
Fold a raw checksum: 'cur_sum' is in host byte order, while the
return value is in network byte order.
Fold a raw checksum : ' cur_sum ' is in host byte order while the return value is in network byte order .
uint16_t
nm_csum_fold(rawsum_t cur_sum)
{
	while (cur_sum >> 16)
		cur_sum = (cur_sum & 0xFFFF) + (cur_sum >> 16);
	return htobe16((~cur_sum) & 0xFFFF);
}
uint16_t nm_csum_fold ( rawsum_t cur_sum ) { while ( cur_sum >> 16 ) cur_sum = ( cur_sum & 0xFFFF ) + ( cur_sum >> 16 ) ; return htobe16 ( ( ~ cur_sum ) & 0xFFFF ) ; }
Fold a raw checksum: 'cur_sum' is in host byte order, while the
 return value is in network byte order.
Fold a raw checksum : ' cur_sum ' is in host byte order while the return value is in network byte order .
/* TODO XXX please use the FreeBSD implementation for this. */