@Igal
Is there a way to open raw socket when implementing a network extension?
You can try to do so but I suspect you will run into a permission issue like what is being described above.
Can the NWParameters.init(customIPProtocolNumber: ) setup can be used in some way to capture well known protocols, such as gre?
I have not tried this. While I have seen other protocol's being defined here in customIPProtocolNumber, I've not see GRE.
On the socket side of the equation, I actually have tried running the following in a Packet Tunnel Provider:
sockd = socket(AF_INET, SOCK_RAW, IPPROTO_GRE);
if (sockd == -1) {
perror("Socket creation error");
}
// Socket creation error: Operation not permitted
// Program ended with exit code: 0
And this was due to the Sandbox.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com