MCPcopy Create free account
hub / github.com/tailscale/tailcat / tcAddrForKey

Function tcAddrForKey

tailcat.go:1331–1344  ·  view source on GitHub ↗
(k key.NodePublic)

Source from the content-addressed store, hash-verified

1329}
1330
1331func tcAddrForKey(k key.NodePublic) netip.Addr {
1332 var a [16]byte
1333 r := k.Raw32()
1334 // Use Tailscale's ULA range fd7a:115c:a1e0::/48, filling the
1335 // remaining 80 bits from the node key.
1336 a[0] = 0xfd
1337 a[1] = 0x7a
1338 a[2] = 0x11
1339 a[3] = 0x5c
1340 a[4] = 0xa1
1341 a[5] = 0xe0
1342 copy(a[6:], r[:10])
1343 return netip.AddrFrom16(a)
1344}
1345
1346func newNetstack(logf logger.Logf, sys *tsd.System) (*netstack.Impl, error) {
1347 return netstack.Create(logf,

Callers 6

newLocoBackendFunction · 0.85
peerAllowedIPsMethod · 0.85
peerByIPMethod · 0.85
StartMethod · 0.85
onMeowMethod · 0.85
initLockedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected