networkextension/SimpleTunnel

createTCPConnection not establishing tunnel in ClientTunnel

jorgeavelar98 opened this issue · 6 comments

Hello @yarshure @networkextension ,

Ive been working on a MacOS per-app vpn client very similar to yours. I seemed to have an issue where the PacketTunnelProvider extension would stop running when ever it would hit the first line in the "observeValue" function in the ClientTunnel class. I noticed that you were having a similar issue and changed a few lines within the ClientTunnel class. I did the same and the app extension no longer stops.

However, the ClientTunnel still seems to fail to establish the tunnel to the server. After I call
connection = provider.createdTCPConnection(parameters)
connection state switched to "connecting" but then switches to "waiting" within the "observeValue" function, meaning that it failed to create the TCP connection. I downloaded and ran your example project and it seems to have the same issue.

So I am wondering if you could help me fix this issue. In your code, right above the line of code you changed, you wrote:
//stop reason = Simultaneous accesses to 0x1037010e8, but modification requires exclusive access
What does "modification requires exclusive access" mean. Is this the issue?

Thanks!

So I run the server on port 8889 and I give my client my computer's IP address along with port 8889 as the server address. (ex: 10.30.56.101:8889). This server address is included in a configuration profile I then install into the Mac and loaded by an NETunnelProviderManager in the host app.

Note: I run the server and per app vpn client on the same Mac computer.

I see, thanks. The one I am having trouble with is the PacketTunnelProvider Extension though. Did that one work the last time you ran it?

zboya commented

@jorgeavelar98 are you fix it now? I have the same problem. It seem provider.createdTCPConnection do not work.

@sheepbao I thank you should open Console.app , see all extension process log. If something wrong , framework will write log .