Oleg Bulyzhin wrote:
On Mon, Feb 06, 2006 at 02:21:09PM -0800, Nate Lawson wrote:
Oleg Bulyzhin wrote:
nq = q->m_nextpkt;
q->m_nextpkt = NULL;
m->m_pkthdr.csum_flags &= q->m_pkthdr.csum_flags;
- m->m_pkthdr.csum_data += q->m_pkthdr.csum_data;
+ sum = m->m_pkthdr.csum_data + q->m_pkthdr.csum_data;
+ m->m_pkthdr.csum_data = (sum & 0xffff) + (sum >> 16);
m_cat(m, q);
}
#ifdef MAC
I'm not familiar with this code. So m->m_pkthdr.csum_data is 32 bits?
Couldn't the same thing be achieved with making it 16 bits since the add
will wrap normally?
It will not work cause it's not just a trivial sum it's so called
"1's complement sum" (refer rfc1071 for details).
You're right, but aren't you missing the NOT step?
1. 2's complement sum
2. Add in carry
3. 1's complement of result (not)
--
Nate
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"