in_cksum_offset(), in_delayed_cksum_offset() question
in_cksum_offset(), in_delayed_cksum_offset() question
- Subject: in_cksum_offset(), in_delayed_cksum_offset() question
- From: Kevin Brock <email@hidden>
- Date: Tue, 23 Jan 2007 10:13:44 -0800
Both of these take an offset for the IP header, and then try to find
the mbuf in the chain that contains the IP header.
What I was wondering about was the line below: if(m)... This first
loop occurs in both of the functions.
It looks as though the function will simply return if the IP header
isn't in the first mbuf. It should be if(!m), to detect the
condition where we've reached the end of the mbuf without finding the
IP offset...
Am I missing something here? If it simply returns any time the IP
header isn't in the first mbuf, then mbuf_outbound_finalize, which
calls these functions, will clear the checksum request flags without
actually doing anything.
void
in_delayed_cksum_offset(struct mbuf *m, int ip_offset)
{
struct ip *ip;
u_short csum, offset;
while (ip_offset > m->m_len) {
ip_offset -= m->m_len;
m = m->m_next;
if (m) {
printf("in_delayed_cksum_withoffset failed - ip_offset wasn't in
the packet\n");
return;
}
}
Kevin Brock
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden