mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-03 16:31:54 +01:00
wgengine/magicsock: fix UDPRelayAllocReq/Resp deadlock (#17831)
Updates #17830 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
18806de400
commit
2ad2d4d409
@ -2444,7 +2444,10 @@ func (c *Conn) handleDiscoMessage(msg []byte, src epAddr, shouldBeRelayHandshake
|
|||||||
if !nodeHasCap(c.filt, c.peers.At(peerI), c.self, tailcfg.PeerCapabilityRelay) {
|
if !nodeHasCap(c.filt, c.peers.At(peerI), c.self, tailcfg.PeerCapabilityRelay) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.allocRelayEndpointPub.Publish(UDPRelayAllocReq{
|
// [Conn.mu] must not be held while publishing, or [Conn.onUDPRelayAllocResp]
|
||||||
|
// can deadlock as the req sub and resp pub are the same goroutine.
|
||||||
|
// See #17830.
|
||||||
|
go c.allocRelayEndpointPub.Publish(UDPRelayAllocReq{
|
||||||
RxFromDiscoKey: sender,
|
RxFromDiscoKey: sender,
|
||||||
RxFromNodeKey: nodeKey,
|
RxFromNodeKey: nodeKey,
|
||||||
Message: req,
|
Message: req,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user