Re: ipf_inject_input returns ENOTSUP
Re: ipf_inject_input returns ENOTSUP
- Subject: Re: ipf_inject_input returns ENOTSUP
- From: Josh Graessley <email@hidden>
- Date: Tue, 20 Sep 2005 10:41:56 -0700
Hi Allan,
Using setsockopt to pass in a whole packet is less than ideal. A much
better strategy is to use send or sendmsg. Your packet will arrive in
your ctl_send_func as an mbuf chain. I hope you're using
ctl_enqueuembuf to send the packet to your user app.
-josh
On Sep 19, 2005, at 6:18 PM, Allan Hoeltje wrote:
Can anyone here tell me how far off the code below is? My kext
swallows IP
packets and sends them to a user app. The user app modifies the
contents of
the RTP data contained in the IP packet and returns the whole IP
packet back
to the kext via the kern_ctl_reg ctl_setopt function which in turn
calls
this injectIPPacket code.
The ipf_inject_input returns ENOTSUP which, according to the Darwin
source
code in kpi_ipfilter.c, means that the IP packet does not have a
vaild IP
version number.
I suspect that I am not setting the first mbuf correctly to
indicate that it
is a M_PKTHDR.
What is the proper way to create an mbuf from (void *) data? I've
searched
the available source code and documentation and have found no complete
solutions.
Also, if I give ipf_inject_input or ipf_inject_output the address
of my IP
filter I get a panic. It is my understanding that if I do not want
this
packet to be seen in my filter again I should set a tag and pass
the filter
in the inject call. Is that correct? Do I need to set a tag and/
or pass
the filter to inject?
Thanks!
-Allan
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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