summaryrefslogtreecommitdiffhomepage
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
parent2496cdd8e6078e2a6955b7facb239e4cf2fe5e55 (diff)
Disappointing anti-sticky experiment
Diffstat (limited to 'peer.go')
-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()
+}