in_cksum_offset(), in_delayed_cksum_offset() question
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Kevin Brock apple@kevin.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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; } } This email sent to site_archiver@lists.apple.com
participants (1)
-
Kevin Brock