summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src
diff options
context:
space:
mode:
Diffstat (limited to 'tunnel/src')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java8
-rw-r--r--tunnel/src/main/java/com/wireguard/util/Resolver.java2
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;
}