Skip to content

Commit d122f03

Browse files
authored
control/controlknobs,tailcfg,wgengine/magicsock: deprecate NodeAttrDisableMagicSockCryptoRouting (tailscale#16818)
Peer Relay is dependent on crypto routing, therefore crypto routing is now mandatory. Updates tailscale/corp#20732 Updates tailscale/corp#31083 Signed-off-by: Jordan Whited <[email protected]>
1 parent 71d51eb commit d122f03

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

control/controlknobs/controlknobs.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ type Knobs struct {
9898
// allows us to disable the new behavior remotely if needed.
9999
DisableLocalDNSOverrideViaNRPT atomic.Bool
100100

101-
// DisableCryptorouting indicates that the node should not use the
102-
// magicsock crypto routing feature.
103-
DisableCryptorouting atomic.Bool
104-
105101
// DisableCaptivePortalDetection is whether the node should not perform captive portal detection
106102
// automatically when the network state changes.
107103
DisableCaptivePortalDetection atomic.Bool
@@ -137,7 +133,6 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
137133
userDialUseRoutes = has(tailcfg.NodeAttrUserDialUseRoutes)
138134
disableSplitDNSWhenNoCustomResolvers = has(tailcfg.NodeAttrDisableSplitDNSWhenNoCustomResolvers)
139135
disableLocalDNSOverrideViaNRPT = has(tailcfg.NodeAttrDisableLocalDNSOverrideViaNRPT)
140-
disableCryptorouting = has(tailcfg.NodeAttrDisableMagicSockCryptoRouting)
141136
disableCaptivePortalDetection = has(tailcfg.NodeAttrDisableCaptivePortalDetection)
142137
disableSkipStatusQueue = has(tailcfg.NodeAttrDisableSkipStatusQueue)
143138
)
@@ -165,7 +160,6 @@ func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
165160
k.UserDialUseRoutes.Store(userDialUseRoutes)
166161
k.DisableSplitDNSWhenNoCustomResolvers.Store(disableSplitDNSWhenNoCustomResolvers)
167162
k.DisableLocalDNSOverrideViaNRPT.Store(disableLocalDNSOverrideViaNRPT)
168-
k.DisableCryptorouting.Store(disableCryptorouting)
169163
k.DisableCaptivePortalDetection.Store(disableCaptivePortalDetection)
170164
k.DisableSkipStatusQueue.Store(disableSkipStatusQueue)
171165
}

tailcfg/tailcfg.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ type CapabilityVersion int
168168
// - 121: 2025-07-19: Client understands peer relay endpoint alloc with [disco.AllocateUDPRelayEndpointRequest] & [disco.AllocateUDPRelayEndpointResponse]
169169
// - 122: 2025-07-21: Client sends Hostinfo.ExitNodeID to report which exit node it has selected, if any.
170170
// - 123: 2025-07-28: fix deadlock regression from cryptokey routing change (issue #16651)
171-
const CurrentCapabilityVersion CapabilityVersion = 123
171+
// - 124: 2025-08-08: removed NodeAttrDisableMagicSockCryptoRouting support, crypto routing is now mandatory
172+
const CurrentCapabilityVersion CapabilityVersion = 124
172173

173174
// ID is an integer ID for a user, node, or login allocated by the
174175
// control plane.
@@ -2590,6 +2591,9 @@ const (
25902591

25912592
// NodeAttrDisableMagicSockCryptoRouting disables the use of the
25922593
// magicsock cryptorouting hook. See tailscale/corp#20732.
2594+
//
2595+
// Deprecated: NodeAttrDisableMagicSockCryptoRouting is deprecated as of
2596+
// CapabilityVersion 124, CryptoRouting is now mandatory. See tailscale/corp#31083.
25932597
NodeAttrDisableMagicSockCryptoRouting NodeCapability = "disable-magicsock-crypto-routing"
25942598

25952599
// NodeAttrDisableCaptivePortalDetection instructs the client to not perform captive portal detection

wgengine/magicsock/magicsock.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,12 +1842,6 @@ func (c *Conn) receiveIP(b []byte, ipp netip.AddrPort, cache *epAddrEndpointCach
18421842
de, ok := c.peerMap.endpointForEpAddr(src)
18431843
c.mu.Unlock()
18441844
if !ok {
1845-
if c.controlKnobs != nil && c.controlKnobs.DisableCryptorouting.Load() {
1846-
// Note: UDP relay is dependent on cryptorouting enablement. We
1847-
// only update Geneve-encapsulated [epAddr]s in the [peerMap]
1848-
// via [lazyEndpoint].
1849-
return nil, 0, false, false
1850-
}
18511845
// TODO(jwhited): reuse [lazyEndpoint] across calls to receiveIP()
18521846
// for the same batch & [epAddr] src.
18531847
return &lazyEndpoint{c: c, src: src}, size, isGeneveEncap, true

0 commit comments

Comments
 (0)