Re: Hello, need some help about socket filter (NKE) development
Re: Hello, need some help about socket filter (NKE) development
- Subject: Re: Hello, need some help about socket filter (NKE) development
- From: Haohao Lee <email@hidden>
- Date: Sat, 15 Sep 2018 15:53:41 +0800
On Fri, Sep 14, 2018 at 4:13 PM Quinn "The Eskimo!" <email@hidden>
wrote:
>
> On 14 Sep 2018, at 07:40, Haohao Lee <email@hidden> 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 (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