mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-30 21:42:48 -08:00
wgengine/magicsock: validate endpoint.derpAddr in Conn.onUDPRelayAllocResp (#17828)
Otherwise a zero value will panic in Conn.sendUDPStd.
Updates #17827
Signed-off-by: Jordan Whited <[email protected]>
(cherry picked from commit 18806de400)
This commit is contained in:
1 parent
28f6c2dbfc
commit
e602907cf5
1 file changed
+3
-1
@@ -651,7 +651,9 @@ func (c *Conn) onUDPRelayAllocResp(allocResp UDPRelayAllocResp) {
|
||||
ep.mu.Lock()
|
||||
defer ep.mu.Unlock()
|
||||
derpAddr := ep.derpAddr
|
||||
go c.sendDiscoMessage(epAddr{ap: derpAddr}, ep.publicKey, disco.key, allocResp.Message, discoVerboseLog)
|
||||
if derpAddr.IsValid() {
|
||||
go c.sendDiscoMessage(epAddr{ap: derpAddr}, ep.publicKey, disco.key, allocResp.Message, discoVerboseLog)
|
||||
}
|
||||
}
|
||||
|
||||
// Synchronize waits for all [eventbus] events published
|
||||
|
||||
Reference in new issue
Block a user