diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-05-22 00:28:14 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-05-22 00:28:14 +0200 |
commit | 05eb2d3d4de5be9159270c5742a5e0c0a5a8591c (patch) | |
tree | 43b59eb8a96a3b797e1157f7e08688af5e3ae54f /tunnel/src/main/java/com/wireguard | |
parent | 9ac518380cdd92abb7e3d75efae67079f0de1aa2 (diff) |
WIP IPv4/IPv6 fixesbuild16
Diffstat (limited to 'tunnel/src/main/java/com/wireguard')
-rw-r--r-- | tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java | 8 | ||||
-rw-r--r-- | tunnel/src/main/java/com/wireguard/util/Resolver.java | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java index 481ef8ae..23ea0e1e 100644 --- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -323,10 +323,10 @@ public final class GoBackend implements Backend { Log.w(TAG, "Wg user string: " + goConfig); LibwgGrpc.LibwgBlockingStub stub = LibwgGrpc.newBlockingStub(channel); - TunnelHandle handle = TunnelHandle.newBuilder().setHandle(currentTunnelHandle).build(); + // TunnelHandle handle = TunnelHandle.newBuilder().setHandle(currentTunnelHandle).build(); // IpcSetRequest request = IpcSetRequest.newBuilder().setTunnel(handle).setConfig(goConfig).build(); // IpcSetResponse resp = stub.ipcSet(request); - wgSetConfig(handle, request); + wgSetConfig(currentTunnelHandle, goConfig); } private static String downloadPacFile(Network network, Uri pacFileUrl) { @@ -877,10 +877,10 @@ public final class GoBackend implements Backend { Log.w(TAG, "is default network, config:" + goConfig); LibwgGrpc.LibwgBlockingStub stub = LibwgGrpc.newBlockingStub(channel); - TunnelHandle tunnel = TunnelHandle.newBuilder().setHandle(currentTunnelHandle).build(); + // TunnelHandle tunnel = TunnelHandle.newBuilder().setHandle(currentTunnelHandle).build(); // IpcSetRequest request = IpcSetRequest.newBuilder().setTunnel(tunnel).setConfig(goConfig).build(); // IpcSetResponse resp = stub.ipcSet(request); - wgSetConfig(handle, request); + wgSetConfig(currentTunnelHandle, goConfig); } } } diff --git a/tunnel/src/main/java/com/wireguard/util/Resolver.java b/tunnel/src/main/java/com/wireguard/util/Resolver.java index 654e01f5..24f5ab88 100644 --- a/tunnel/src/main/java/com/wireguard/util/Resolver.java +++ b/tunnel/src/main/java/com/wireguard/util/Resolver.java @@ -111,6 +111,7 @@ public class Resolver { if (sock.getLocalAddress().isAnyLocalAddress()) { // Connect didn't find a local address. Log.w(TAG, "No local address"); + sock.close(); continue; } @@ -119,6 +120,7 @@ public class Resolver { if (candidate instanceof Inet4Address) { // Accept IPv4 as preferred address. address = candidate; + sock.close(); break; } |