MCPcopy Index your code
hub / github.com/tailscale/tailscale / netaddrIPFromNetstackIP

Function netaddrIPFromNetstackIP

wgengine/netstack/netstack.go:1497–1505  ·  view source on GitHub ↗
(s tcpip.Address)

Source from the content-addressed store, hash-verified

1495}
1496
1497func netaddrIPFromNetstackIP(s tcpip.Address) netip.Addr {
1498 switch s.Len() {
1499 case 4:
1500 return netip.AddrFrom4(s.As4())
1501 case 16:
1502 return netip.AddrFrom16(s.As16()).Unmap()
1503 }
1504 return netip.Addr{}
1505}
1506
1507var (
1508 ipv4Loopback = netip.MustParseAddr("127.0.0.1")

Callers 2

UpdateNetstackIPsMethod · 0.70
acceptTCPMethod · 0.70

Calls 1

LenMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…