aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-26 02:59:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-27 22:55:15 +0200
commitfc3a7635e56a336ae06277ce3157b1b14fdd2fa8 (patch)
treef11ddb7168799c81fc6f5a73949a58e646d627a2 /peer.go
parentFix tests (diff)
downloadwireguard-go-fc3a7635e56a336ae06277ce3157b1b14fdd2fa8.tar.xz
wireguard-go-fc3a7635e56a336ae06277ce3157b1b14fdd2fa8.zip
Disappointing anti-sticky experiment
Diffstat (limited to '')
-rw-r--r--peer.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/peer.go b/peer.go
index a279d96..228dc5e 100644
--- a/peer.go
+++ b/peer.go
@@ -258,3 +258,14 @@ func (peer *Peer) Stop() {
peer.ZeroAndFlushAll()
}
+
+var roamingDisabled bool
+
+func (peer *Peer) SetEndpointFromPacket(endpoint Endpoint) {
+ if roamingDisabled {
+ return
+ }
+ peer.mutex.Lock()
+ peer.endpoint = endpoint
+ peer.mutex.Unlock()
+}