wgengine/magicsock: fix data race regression in disco ping callbacks

Regression from c15997511d. The callback could be run multiple times
from different endpoints.

Fixes #9801

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-10-14 13:16:04 -07:00
committed by Brad Fitzpatrick
parent 5297bd2cff
commit a6270826a3
2 changed files with 33 additions and 21 deletions

View File

@@ -757,7 +757,7 @@ func (c *Conn) Ping(peer tailcfg.NodeView, res *ipnstate.PingResult, size int, c
cb(res)
return
}
ep.cliPing(res, size, cb)
ep.discoPing(res, size, cb)
}
// c.mu must be held