mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 05:07:33 +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
@@ -16,7 +16,6 @@ import (
|
||||
"github.com/mdlayher/netlink"
|
||||
"golang.org/x/sys/unix"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/net/netaddr"
|
||||
"tailscale.com/net/tsaddr"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
@@ -237,13 +236,13 @@ func (c *nlConn) Receive() (message, error) {
|
||||
}
|
||||
|
||||
func netaddrIP(std net.IP) netip.Addr {
|
||||
ip, _ := netaddr.FromStdIP(std)
|
||||
return ip
|
||||
ip, _ := netip.AddrFromSlice(std)
|
||||
return ip.Unmap()
|
||||
}
|
||||
|
||||
func netaddrIPPrefix(std net.IP, bits uint8) netip.Prefix {
|
||||
ip, _ := netaddr.FromStdIP(std)
|
||||
return netip.PrefixFrom(ip, int(bits))
|
||||
ip, _ := netip.AddrFromSlice(std)
|
||||
return netip.PrefixFrom(ip.Unmap(), int(bits))
|
||||
}
|
||||
|
||||
func condNetAddrPrefix(ipp netip.Prefix) string {
|
||||
|
Reference in New Issue
Block a user