Re: mbuf_outbound_finalize() reports packet length is less than mbuf length
Re: mbuf_outbound_finalize() reports packet length is less than mbuf length
- Subject: Re: mbuf_outbound_finalize() reports packet length is less than mbuf length
- From: Andrew Gallatin <email@hidden>
- Date: Tue, 28 Jul 2009 07:04:05 -0400
Brendan Creane wrote:
The code block that does the pullup is:
if (mbuf_len(m) == ifnet_hdrlen(interface)) {
err = mbuf_pullup(&m, sizeof(struct iphdr));
Rather than just pulling up 20 bytes, you should dereference
the IP hdr and pull up the actual size of the hdr (which can be
longer than sizeof(struct iphdr) if there are options).
if (err != KERN_SUCCESS) {
printf("drv::Filter::pkt_out() - mbuf_pullup err=%d\n", err);
return EJUSTRETURN; // "swallow" the packet -
mbuf_pullup frees the mbuf on failure
}
}
It looks like mbuf_pullup() correctly sets the "PKTHDR" flag when it
allocates a new mbuf and the original mbuf has that bit set. So the
reason for the panic isn't clear to me, at this point.
What does the mbuf chain look like at this point?
Drew
_______________________________________________
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