site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Carl, Please don't cross-post. On Jun 28, 2005, at 11:46 , Carl Smith wrote: You mean "m_devget"? struct mbuf m; // create the new mbuf with m_dev m->m_pkthdr.rcvif = m_saved->m_pkthdr.rcvif; Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for General Semantics -------- Men are from Earth. Women are from Earth. Deal with it. -------- _______________________________________________ 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... Here’s my dilemma, I have driver, in the kernel, that I catch all incoming and outgoing packets. To be nit-picky, it's an NKE, not a driver (and darwin-kernel is the right list). It is working. My hesitation lies in the outgoing packets. For my purposes I create new mbufs, and load my data into the mbuf and out it goes. I create my mbuf with m_dev. Now with some help, from this forum, I set my values, in the new mbuf as: m->m_pkthdr.header = (void*)m_mtod(m); You have 'm' declared as a struct mbuf, not a struct mbuf *; you mean the latter? My questions are, I am saving the m_pkthdr.rcvif from the ‘captured’ mbuf in my filter. I feel that this is unnecessary and potential dangerous, now is there some way to create an m_pkthdr.rcvif (a struct ifnet item) from scratch or is there some reason I need the original from the interface I am currently filtering? Does the m_dev function create a new m_pkthdr.rcvif for me? m_devget() takes an "ifp" as one of its arguments, and stores that in the rcvif slot. You can check this yourself, of course, using the Darwin source for the kernel; that's why it's there :-} (well, that's one reason it's there). This email sent to site_archiver@lists.apple.com