Disappointing anti-sticky experiment

This commit is contained in:
Jason A. Donenfeld
2018-05-26 02:59:26 +02:00
parent 2496cdd8e6
commit fc3a7635e5
4 changed files with 22 additions and 29 deletions

11
peer.go
View File

@@ -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()
}