boundif: introduce API for socket binding

This commit is contained in:
Jason A. Donenfeld
2019-03-03 05:01:06 +01:00
parent 69f0fe67b6
commit b8e85267cf
8 changed files with 155 additions and 21 deletions

View File

@@ -258,10 +258,10 @@ func (peer *Peer) Stop() {
peer.ZeroAndFlushAll()
}
var roamingDisabled bool
var RoamingDisabled bool
func (peer *Peer) SetEndpointFromPacket(endpoint Endpoint) {
if roamingDisabled {
if RoamingDisabled {
return
}
peer.Lock()