Re: Darwin-kernel Digest, Vol 15, Issue 30
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thanks so much, Eskimo! ! Yeah, that was the thinking - Why would there be just one filter …. Now I need to dig to see why it is not loading the 2nd one. I’m testing on Mojave, but it should be fine. Also I subscribed to the MacNetworkProg group so I will post there anything related to Networking. -Pro
On 19 Sep 2018, at 21:31, Prokash Sinha <prokash@garlic.com> wrote:
So there are two returns to indicate, if the kernel continue thru the chain or not.
It’s based on the function result:
* 0 sends the request down the chain
* `EJUSTRETURN` prevents the request going down the chain but doesn’t signal an error to the caller
* any other error prevents the request going down the chain and signals that error to the caller
You can see this in action in Darwin. For example, consider your `sf_data_out` function. It’s called by `sflt_data_out`, which iterates through the filters call the `sf_data_out` on each filter. That returns if it gets any error. The caller, `sosend`, specifically looks for `EJUSTRETURN` and… well… just returns
<https://opensource.apple.com/source/xnu/xnu-4570.1.46/bsd/kern/kpi_socketfilter.c>
<https://opensource.apple.com/source/xnu/xnu-4570.1.46/bsd/kern/uipc_socket.c>
ps You might want to post your socket filter questions to the MacNetworkProg mailing list. While I’m happy to answer them here, that list has other members with direct experience with this stuff.
<https://lists.apple.com/mailman/listinfo/macnetworkprog>
Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
On 20 Sep 2018, at 17:37, Prokash Sinha <prokash@garlic.com> wrote:
As it turned out, it seems like not possible to have more than one socket filter for same protocol …
That’s definitely not correct. I’m not sure why your second socket filter is failing to register, but multiple socket filters are supported.
Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________ 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: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Prokash Sinha