Is it possible to return my custom error type as part of drop()?

Hi,
I have Content Filter simple firewall app. I am dropping SSH connection as part my app as per my policy evaluation result and I am expecting my custom error type EACCES(permission denied) whenever user tries SSH But drop() is returning with EBADF (Bad file descriptor).

Is it possible to return my custom error type as part of drop()?

Below is sample code I have.

Code Block
override func handleNewFlow(_ flow: NEFilterFlow) -> NEFilterNewFlowVerdict {
DispatchQueue.global(qos: .default).async {
// errortype is EACCES for drop case and errorType is 0 for allow case
  userVerdict = errortype == 0 ? .allow() : .drop()
  self.resumeFlow(flow, with: userVerdict)
}
return .pause()
}

Okay. Did this behavior suddenly change in your application and are you relying on EACCES in some way? The short answer here is that different errors could end up as a result for different reasons in the OS based upon a variety of situations. If this is a changed behavior, then it could be a result of a behavior change in an OS update. If this behavior is not dropping the flow then that would be grounds for a bug report.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Here I am want to return EACCES while dropping the connection but OS is returning EBADF error. Here, my requirement is to add my relying error EACCES instead of OS error at the time of drop. So, Is it possible to return EACCES error instead of OS error for the drop()? If possible, How can I achieve this? Thanks.
Is it possible to return my custom error type as part of drop()?
 
 
Q