summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
diff options
context:
space:
mode:
Diffstat (limited to 'tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java6
1 files changed, 5 insertions, 1 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 9c96e00f..7b1d94fd 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
@@ -422,7 +422,11 @@ public final class GoBackend implements Backend {
}
LibwgGrpc.LibwgBlockingStub stub = LibwgGrpc.newBlockingStub(channel);
- DhcpRequest request = DhcpRequest.newBuilder().setSource(source).build();
+ DhcpRequest.Builder requestBuilder = DhcpRequest.newBuilder();
+ if (source != null) {
+ requestBuilder.setSource(source);
+ }
+ DhcpRequest request = requestBuilder.build();
DhcpResponse resp = stub.dhcp(request);
Log.i(TAG, "Dhcp: " + resp.getError().getMessage());