wgengine/magicsock: fix panic regression from cryptokey routing change

Fixes #13332
Updates tailscale/corp#20732

Change-Id: I30f12746844bf77f5a664bf8e8d8ebf2511a2b27
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
dependabot/npm_and_yarn/cmd/tsconnect/micromatch-4.0.8
Brad Fitzpatrick 3 months ago committed by Brad Fitzpatrick
parent 2f2aeaeaeb
commit 65fe0ba7b5

@ -1089,7 +1089,13 @@ func (c *Conn) Send(buffs [][]byte, ep conn.Endpoint) error {
metricSendDataNetworkDown.Add(n) metricSendDataNetworkDown.Add(n)
return errNetworkDown return errNetworkDown
} }
return ep.(*endpoint).send(buffs) if ep, ok := ep.(*endpoint); ok {
return ep.send(buffs)
}
// If it's not of type *endpoint, it's probably *lazyEndpoint, which means
// we don't actually know who the peer is and we're waiting for wireguard-go
// to switch the endpoint. See go/corp/20732.
return nil
} }
var errConnClosed = errors.New("Conn closed") var errConnClosed = errors.New("Conn closed")

Loading…
Cancel
Save