Re: Passing up per-socket data from NKE
Re: Passing up per-socket data from NKE
- Subject: Re: Passing up per-socket data from NKE
- From: Joe Lowe <email@hidden>
- Date: Mon, 06 Sep 2010 10:16:04 -0700
> Off topic perhaps, but if you've solved the issue of making sure a
> socket doesn't get detached while you're calling sock_xyz() from your
> kext (outside a sflt callback), I'd be interested in finding out how.
This seems related to sock_retain and sock_release not being public
kernel exports.
http://lists.apple.com/archives/darwin-kernel/2010/Jul/msg00031.html
http://lists.apple.com/archives/Macnetworkprog/2006/Dec/msg00057.html
Joe L.
Bogdan Harjoc wrote:
SIOCGIFKPI sounds like an interface ioctl, which the socket level
filter may not be receiving. And looking at where the ioctl call ends
up (the IOCGROUP for SIOCGIFKPI is 'i' for 'interface'):
ioctl
soioctl
/* Call the socket filter's ioctl handler for most ioctls */
if (IOCGROUP(cmd) != 'i' && IOCGROUP(cmd) != 'r') { ... }
...
ifioctllocked
ifioctl
ifp = ifunit(ifr->ifr_name);
if (ifp == 0) return ENXIO;
...
if (cmd == SIOCSIFKPI) {... }
...
ifnet_ioctl(...)
it looks like that SIOCSIFKPI is strictly handled by interface code
(and filters).
You can just use getsockopt instead, for a SOL_SOCKET option. I can
provide some example code but it should be straightforward.
Off topic perhaps, but if you've solved the issue of making sure a
socket doesn't get detached while you're calling sock_xyz() from your
kext (outside a sflt callback), I'd be interested in finding out how.
HTH,
Bogdan
On Sat, Sep 4, 2010 at 2:07 PM, Matt Slot <email@hidden> wrote:
ioctl(tcpSocket, SIOCGIFKPI, &myreq);
The last call is failing with ENXIO, and I never see the ioctl() come through.
_______________________________________________
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
_______________________________________________
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