device: only propagate roaming value before peer is referenced elsewhere
A peer.endpoint never becomes nil after being not-nil, so creation is the only time we actually need to set this. This prevents a race from when the variable is actually used elsewhere, and allows us to avoid an expensive atomic. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
fc4f975a4d
commit
de7c702ace
|
@ -261,7 +261,9 @@ func (peer *ipcSetPeer) handlePostConfig() {
|
||||||
if peer.Peer == nil || peer.dummy {
|
if peer.Peer == nil || peer.dummy {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if peer.created {
|
||||||
peer.disableRoaming = peer.device.net.brokenRoaming && peer.endpoint != nil
|
peer.disableRoaming = peer.device.net.brokenRoaming && peer.endpoint != nil
|
||||||
|
}
|
||||||
if peer.device.isUp() {
|
if peer.device.isUp() {
|
||||||
peer.Start()
|
peer.Start()
|
||||||
if peer.pkaOn {
|
if peer.pkaOn {
|
||||||
|
|
Loading…
Reference in a new issue