mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-31 00:03:47 +00:00

Just make [relayManager] always handle it, there's no benefit to checking bestAddr's. Also, remove passing of disco.Pong to [relayManager] in endpoint.handlePongConnLocked(), which is redundant with the callsite in Conn.handleDiscoMessage(). Conn.handleDiscoMessage() already passes to [relayManager] if the txID us not known to any [*endpoint]. Updates tailscale/corp#27502 Signed-off-by: Jordan Whited <jordan@tailscale.com>
36 lines
933 B
Go
36 lines
933 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package magicsock
|
|
|
|
import (
|
|
"net/netip"
|
|
"testing"
|
|
|
|
"tailscale.com/disco"
|
|
"tailscale.com/types/key"
|
|
"tailscale.com/util/set"
|
|
)
|
|
|
|
func TestRelayManagerInitAndIdle(t *testing.T) {
|
|
rm := relayManager{}
|
|
rm.startUDPRelayPathDiscoveryFor(&endpoint{}, addrQuality{}, false)
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.stopWork(&endpoint{})
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.handleCallMeMaybeVia(&endpoint{c: &Conn{discoPrivate: key.NewDisco()}}, addrQuality{}, false, &disco.CallMeMaybeVia{ServerDisco: key.NewDisco().Public()})
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.handleGeneveEncapDiscoMsg(&Conn{discoPrivate: key.NewDisco()}, &disco.BindUDPRelayEndpointChallenge{}, &discoInfo{}, epAddr{})
|
|
<-rm.runLoopStoppedCh
|
|
|
|
rm = relayManager{}
|
|
rm.handleRelayServersSet(make(set.Set[netip.AddrPort]))
|
|
<-rm.runLoopStoppedCh
|
|
}
|