diff --git a/wgengine/magicsock/debugknobs.go b/wgengine/magicsock/debugknobs.go index adfff17d2..6f42dfb22 100644 --- a/wgengine/magicsock/debugknobs.go +++ b/wgengine/magicsock/debugknobs.go @@ -9,8 +9,6 @@ "tailscale.com/envknob" ) -const linkDebug = true - // Various debugging and experimental tweakables, set by environment // variable. var ( diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 2136bdb1d..9dc17d9f4 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -3983,30 +3983,6 @@ func simpleDur(d time.Duration) time.Duration { return d.Round(time.Minute) } -func sbPrintAddr(sb *strings.Builder, a netip.AddrPort) { - is6 := a.Addr().Is6() - if is6 { - sb.WriteByte('[') - } - fmt.Fprintf(sb, "%s", a.Addr()) - if is6 { - sb.WriteByte(']') - } - fmt.Fprintf(sb, ":%d", a.Port()) -} - -func (c *Conn) derpRegionCodeOfAddrLocked(ipPort string) string { - _, portStr, err := net.SplitHostPort(ipPort) - if err != nil { - return "" - } - regionID, err := strconv.Atoi(portStr) - if err != nil { - return "" - } - return c.derpRegionCodeOfIDLocked(regionID) -} - func (c *Conn) derpRegionCodeOfIDLocked(regionID int) string { if c.derpMap == nil { return "" @@ -4074,13 +4050,6 @@ func (c *Conn) SetStatistics(stats *connstats.Statistics) { c.stats.Store(stats) } -func ippDebugString(ua netip.AddrPort) string { - if ua.Addr() == derpMagicIPAddr { - return fmt.Sprintf("derp-%d", ua.Port()) - } - return ua.String() -} - // endpointSendFunc is a func that writes encrypted Wireguard payloads from // WireGuard to a peer. It might write via UDP, DERP, both, or neither. // @@ -4113,7 +4082,6 @@ type endpoint struct { // atomically accessed; declared first for alignment reasons lastRecv mono.Time numStopAndResetAtomic int64 - sendFunc syncs.AtomicValue[endpointSendFunc] // nil or unset means unused debugUpdates *ringbuffer.RingBuffer[EndpointChange] // These fields are initialized once and never modified. @@ -4146,7 +4114,6 @@ type endpoint struct { // implementation that's a WIP as of 2022-10-20. // See #540 for background. heartbeatDisabled bool - pathFinderRunning bool expired bool // whether the node has expired isWireguardOnly bool // whether the endpoint is WireGuard only @@ -4539,23 +4506,12 @@ func (de *endpoint) cliPing(res *ipnstate.PingResult, cb func(*ipnstate.PingResu ) func (de *endpoint) send(buffs [][]byte) error { - if fn := de.sendFunc.Load(); fn != nil { - return fn(buffs) - } - de.mu.Lock() if de.expired { de.mu.Unlock() return errExpired } - // if heartbeat disabled, kick off pathfinder - if de.heartbeatDisabled { - if !de.pathFinderRunning { - de.startPathFinder() - } - } - now := mono.Now() udpAddr, derpAddr, startWGPing := de.addrForSendLocked(now) @@ -4912,9 +4868,6 @@ func (de *endpoint) updateFromNode(n *tailcfg.Node, heartbeatDisabled bool) { de.deleteEndpointLocked("updateFromNode", ep) } } - - // Node changed. Invalidate its sending fast path, if any. - de.sendFunc.Store(nil) } // addCandidateEndpoint adds ep as an endpoint to which we should send diff --git a/wgengine/magicsock/magicsock_default.go b/wgengine/magicsock/magicsock_default.go index 4dda3c8a6..87075e522 100644 --- a/wgengine/magicsock/magicsock_default.go +++ b/wgengine/magicsock/magicsock_default.go @@ -31,10 +31,6 @@ func getGSOSizeFromControl(control []byte) (int, error) { func setGSOSizeInControl(control *[]byte, gso uint16) {} -func errShouldDisableOffload(err error) bool { - return false -} - const ( controlMessageSize = 0 ) diff --git a/wgengine/magicsock/pathfinder.go b/wgengine/magicsock/pathfinder.go deleted file mode 100644 index 830709d24..000000000 --- a/wgengine/magicsock/pathfinder.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Tailscale Inc & AUTHORS -// SPDX-License-Identifier: BSD-3-Clause - -package magicsock - -// startPathFinder initializes the atomicSendFunc, and -// will eventually kick off a goroutine that monitors whether -// that sendFunc is still the best option for the endpoint -// to use and adjusts accordingly. -func (de *endpoint) startPathFinder() { - de.pathFinderRunning = true -}