mirror of
https://github.com/slackhq/nebula.git
synced 2026-08-16 10:36:59 +02:00
Make HostInfo.remote atomic to fix torn reads on the send path (#1773)
This commit is contained in:
@@ -174,9 +174,9 @@ func (p *Punchy) SendPunch(hostinfo *HostInfo) {
|
||||
|
||||
if p.punchEverything.Load() {
|
||||
p.sendPunchToAllRemotes(hostinfo)
|
||||
} else if hostinfo.remote.IsValid() {
|
||||
} else if hr := hostinfo.GetRemote(); hr.IsValid() {
|
||||
p.metricPunchyTx.Inc(1)
|
||||
p.punchConn.WriteTo([]byte{1}, hostinfo.remote)
|
||||
p.punchConn.WriteTo([]byte{1}, hr)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user