dlil Inject Problem
Greetings, I've got an interface filter NKE that's trying to inject an output packet that its filter function either consumed earlier or created. The packet is logically a roughly 1000 byte long ping response. The problem is that dlil_inject_if_output() returns 22 (EINVAL) and refuses to send the packet. I've added code to dump the mbuf chain and it consists of 2 parts (linked via the mbuf's m_next field). The first part is 14 bytes long and looks like a valid etherframe header (2 MAC addresses and a $0800 IP type). The second part (996 bytes long) looks like a valid IP header and then the ping payload. I've looked through the docs and the xnu source for dlil_inject_if_output() and the EINVAL return is either coming from another interface filter or from the driver itself. Either way I don't know what is invalid about the arguments. The last data point is that since the docs for dlil_inject_if_output() say the packet must have its frame header I used M_PREPEND() and a bcopy(... mtod()) to put the header in. (I then dump that to see the two-buffer mbuf chain.) I have to assume that M_PREPEND decided to link in a new buffer at the front of the mbuf. Is having a linked mbuf chain my problem? Is that supposed to only be used for representing multiple packets not different parts of one packet? If so then why did M_PREPEND do that? If not then what else might be wrong? Thanks, Mike _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Michael Cashwell