all: use various net/netip parse funcs directly
Mechanical change with perl+goimports. Changed {Must,}Parse{IP,IPPrefix,IPPort} to their netip variants, then goimports -d . Finally, removed the net/netaddr wrappers, to prevent future use. Updates #5162 Change-Id: I59c0e38b5fbca5a935d701645789cddf3d7863ad Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
730ca4203c
commit
6a396731eb
@ -1589,9 +1589,9 @@ func dnsIPsOverTailscale(dnsCfg *dns.Config, routerCfg *router.Config) (ret []ne
|
||||
|
||||
add := func(resolvers []*dnstype.Resolver) {
|
||||
for _, r := range resolvers {
|
||||
ip, err := netaddr.ParseIP(r.Addr)
|
||||
ip, err := netip.ParseAddr(r.Addr)
|
||||
if err != nil {
|
||||
if ipp, err := netaddr.ParseIPPort(r.Addr); err == nil {
|
||||
if ipp, err := netip.ParseAddrPort(r.Addr); err == nil {
|
||||
ip = ipp.Addr()
|
||||
} else {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user