From 26481951455cc77fec106651c946755174c675ef Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Wed, 4 Dec 2024 15:30:19 +0100 Subject: [PATCH] Ignore error of socket protection (#37) It is a workaround to allow change server without VPN permission --- android/tool/src/main/java/io/netbird/client/tool/IFace.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/tool/src/main/java/io/netbird/client/tool/IFace.java b/android/tool/src/main/java/io/netbird/client/tool/IFace.java index 313138f..2d8003f 100644 --- a/android/tool/src/main/java/io/netbird/client/tool/IFace.java +++ b/android/tool/src/main/java/io/netbird/client/tool/IFace.java @@ -40,7 +40,10 @@ public long configureInterface(String address, long mtu, String dns, String sear @Override public boolean protectSocket(int fd) { - return vpnService.protect(fd); + vpnService.protect(fd); + // Ignore the error to allow the app to connect to a Management server before the VPN service + // is up and running. This is just a workaround and should be removed in the future. + return true; } private int createTun(String ip, int prefixLength, int mtu, String dns, String[] searchDomains, LinkedList routes) throws Exception {