mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
all: migrate more code code to net/netip directly
Instead of going through the tailscale.com/net/netaddr transitional wrappers. Updates #5162 Change-Id: I3dafd1c2effa1a6caa9b7151ecf6edd1a3fda3dd Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
eb32847d85
commit
8725b14056
@@ -140,7 +140,7 @@ func (n *Network) allocIPv4(iface *Interface) netip.Addr {
|
||||
}
|
||||
a := n.lastV4.As16()
|
||||
addOne(&a, 15)
|
||||
n.lastV4 = netaddr.IPFrom16(a)
|
||||
n.lastV4 = netip.AddrFrom16(a).Unmap()
|
||||
if !n.Prefix4.Contains(n.lastV4) {
|
||||
panic("pool exhausted")
|
||||
}
|
||||
@@ -159,7 +159,7 @@ func (n *Network) allocIPv6(iface *Interface) netip.Addr {
|
||||
}
|
||||
a := n.lastV6.As16()
|
||||
addOne(&a, 15)
|
||||
n.lastV6 = netaddr.IPFrom16(a)
|
||||
n.lastV6 = netip.AddrFrom16(a).Unmap()
|
||||
if !n.Prefix6.Contains(n.lastV6) {
|
||||
panic("pool exhausted")
|
||||
}
|
||||
|
Reference in New Issue
Block a user