aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRoger Chuang <lchuang@mozilla.com>2019-11-28 14:23:49 +0800
committerRoger Chuang <lchuang@mozilla.com>2019-11-28 14:23:49 +0800
commit0cbc47608b11182ebc0fb3013ae5433c366f6a96 (patch)
treedece7ab7d1bbcd391105ef29263b56add63dcc96
parentUse Channel instead of LiveData to deliver VpnService instance (diff)
downloadwireguard-android-0cbc47608b11182ebc0fb3013ae5433c366f6a96.tar.xz
wireguard-android-0cbc47608b11182ebc0fb3013ae5433c366f6a96.zip
Clear tunnel's tunnelHandle once it's down, so tunnel.state can return correct tunnel state
Signed-off-by: Roger Chuang <lchuang@mozilla.com>
-rw-r--r--libwg/src/main/java/com/wireguard/android/backend/VpnServiceBackend.kt1
1 files changed, 1 insertions, 0 deletions
diff --git a/libwg/src/main/java/com/wireguard/android/backend/VpnServiceBackend.kt b/libwg/src/main/java/com/wireguard/android/backend/VpnServiceBackend.kt
index 542cdfe6..05896ab2 100644
--- a/libwg/src/main/java/com/wireguard/android/backend/VpnServiceBackend.kt
+++ b/libwg/src/main/java/com/wireguard/android/backend/VpnServiceBackend.kt
@@ -31,6 +31,7 @@ class VpnServiceBackend : BackendNative {
fun tunnelDown(tunnel: Tunnel) {
val socket = tunnel.tunnelHandle ?: return
wgTurnOff(socket)
+ tunnel.tunnelHandle = null
}
fun getVersion(): String {