diff options
| author | Josh Bleecher Snyder <josh@tailscale.com> | 2021-05-12 16:23:38 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josh@tailscale.com> | 2021-05-12 16:23:38 -0700 |
| commit | eec74d42efe433ba15806aa87f00ccf4427463ba (patch) | |
| tree | 72dbf9b4d4e373094d90801944216cf9a66f499c /ipn | |
| parent | ebcd7ab89042fb660a96a75a360ce17140084435 (diff) | |
| download | tailscale-josh/IPWithPort.tar.xz tailscale-josh/IPWithPort.zip | |
ip.WithPortjosh/IPWithPort
Diffstat (limited to 'ipn')
| -rw-r--r-- | ipn/ipnlocal/local.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 00065623a..8aa12105d 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -1796,10 +1796,7 @@ func parseResolver(cfg tailcfg.DNSResolver) (netaddr.IPPort, error) { if err != nil { return netaddr.IPPort{}, fmt.Errorf("[unexpected] non-IP resolver %q", cfg.Addr) } - return netaddr.IPPort{ - IP: ip, - Port: 53, - }, nil + return ip.WithPort(53), nil } // tailscaleVarRoot returns the root directory of Tailscale's writable @@ -2580,9 +2577,9 @@ func peerAPIBase(nm *netmap.NetworkMap, peer *tailcfg.Node) string { var ipp netaddr.IPPort switch { case have4 && p4 != 0: - ipp = netaddr.IPPort{IP: nodeIP(peer, netaddr.IP.Is4), Port: p4} + ipp = nodeIP(peer, netaddr.IP.Is4).WithPort(p4) case have6 && p6 != 0: - ipp = netaddr.IPPort{IP: nodeIP(peer, netaddr.IP.Is6), Port: p6} + ipp = nodeIP(peer, netaddr.IP.Is6).WithPort(p6) } if ipp.IP.IsZero() { return "" |
