wgengine/magicsock: implement relayManager handshaking (#15977)

CallMeMaybeVia reception and endpoint allocation have been collapsed to
a single event channel. discoInfo caching for active relay handshakes
is now implemented.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2025-05-16 13:51:40 -07:00
committed by GitHub
parent 9c52856af6
commit 6de4a021bb
4 changed files with 396 additions and 58 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import (
"testing"
"tailscale.com/disco"
"tailscale.com/types/key"
)
func TestRelayManagerInitAndIdle(t *testing.T) {
@@ -16,11 +17,11 @@ func TestRelayManagerInitAndIdle(t *testing.T) {
<-rm.runLoopStoppedCh
rm = relayManager{}
rm.cancelOutstandingWork(&endpoint{})
rm.stopWork(&endpoint{})
<-rm.runLoopStoppedCh
rm = relayManager{}
rm.handleCallMeMaybeVia(&disco.CallMeMaybeVia{})
rm.handleCallMeMaybeVia(&endpoint{c: &Conn{discoPrivate: key.NewDisco()}}, &disco.CallMeMaybeVia{ServerDisco: key.NewDisco().Public()})
<-rm.runLoopStoppedCh
rm = relayManager{}