Re: Hello, need some help about socket filter (NKE) development
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qTKvZMjwxmLOsu3u6guUg0Z49UvXZOv6jCrPsdjRF2M=; b=JgHDOJocaRUiJ4DQDi138/Wpq//ng8LaLCVpOkQexqmpBTTc+UqQvxcYKYmV8WPSWe hfTQI80CF+pceI8A6sL/BUS7sERDHwQc0p1tMXGsEfTTo7HK0JFqCgnbAOHSPVz0TJDz E+SYb/iD+fp7rA11OppNr2TLplzBGwkeffusIOsJDLsXYp1wFazgVKvCg4ZsRQf50HHM Z+yiryrseDSuIvvxqzLODb+kk6hpIc3SePd8lvxji6tdopEmOSbe2UvYE4KT8P086Af7 NOIoGu0g2Adt9nX5E1SCqaM0rW2W7vQLSFrFEXwyOpXejTKC9eRJdaHwnURgq41LWrZC ytJw== On Fri, Sep 14, 2018 at 4:13 PM Quinn "The Eskimo!" <eskimo1@apple.com> wrote:
On 14 Sep 2018, at 07:40, Haohao Lee <hayatelee@gmail.com> wrote:
How can I get the local address in sf_connect_out_func or is there another way to achieve this?
Have you tried calling `sock_getsockname`? If anything is going to work, that’d be it.
Yes. If I call `sock_getsockname` in `sf_connect_out_func`, an empty address will be returned. I think it is still in the early stage of a connection, there is no local address allocated. One more thing I found, I can get local address by `sock_getsockname` in `sf_notify_fn` for some event. BUT, in `sf_notify_fn` I cannot filter the trafiic since it is a void function.
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/hayatelee%40gmail.com
This email sent to hayatelee@gmail.com
_______________________________________________ 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)
-
Haohao Lee