I'm implementing NEFIlterDataProvider where I would like to drop sockets that will be bound to specific interface, but I can't find interface parameter anywhere. Is that even possible to do? I tried to do the same thing with NEFilterPacketProvider, which provides interface information in packetHandler callback, but callback always provides physical interface (en0) even though I'm connected to VPN and should provide virtual interface. Can you give me a hint how could I drop packets or sockets bound to specific network interface?
but localEndpoint of a NEFilterSocketFlow usually has 0.0.0.0 hostname so I can not match it with any interface. Is there a way to get actual IP address of a localEndpoint?
Usually the localEndpoint will stay either the default address or nil until the actual connection is made. When handleNewFlow
provides:
[NEFilterNewFlowVerdict filterDataVerdictWithFilterInbound:YES peekInboundBytes:PEEKSIZE filterOutbound:YES peekOutboundBytes:PEEKSIZE];
and the flow starts receiving/sending data from handleInboundDataFromFlow
and handleOutboundDataFromFlow
do you still see the localEndpoint
being the default address or nil?
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com