NEFilterPacketProvider packetHandler closure never called

I am using NEFilterPacketProvider and I am able to get the provider to call startFilter correctly. However, I am unable to get the packetHandler closure to get called. What could be wrong?

Code Block
   override func startFilter(completionHandler: @escaping (Error?) -> Void) {
    os_log("Started Packet Filter")
    self.packetHandler = { (context, interface, direction, packetBytes, packetLength) in
      os_log("Dropping packet")
      return .drop
}
     
completionHandler(nil)
  }


I am running the application within a macOS 10.16 VM in Xcode with SIP disabled.

However, I am unable to get the packetHandler closure to get called.

Did you set filterPackets when you set up your filter provider configuration?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

Did you set filterPackets when you set up your filter provider configuration?

Yes, I have. What else could be wrong? Also, I should be receiving all network packets correct?

What else could be wrong?

To confirm, your provider starts? That is, you see that Started Packet Filter log message?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

To confirm, your provider starts? That is, you see that Started Packet Filter log message?

Yes, my provider initializes and startFilter is called. I can see the Started Packet Filter log message. I do not see the Dropping Packet log message.

Have you been able to figure this out? I am running into the same thing. PacketProvider initializes fine, gets startFilter called just fine, but the packetHandler never actually gets called. Nothing in the logs for nesessionmanager, neagent, or sysextd that I can find to see what's going wrong.

NEFilterPacketProvider packetHandler closure never called
 
 
Q