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 /wgengine/netstack | |
| parent | ebcd7ab89042fb660a96a75a360ce17140084435 (diff) | |
| download | tailscale-josh/IPWithPort.tar.xz tailscale-josh/IPWithPort.zip | |
ip.WithPortjosh/IPWithPort
Diffstat (limited to 'wgengine/netstack')
| -rw-r--r-- | wgengine/netstack/netstack.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wgengine/netstack/netstack.go b/wgengine/netstack/netstack.go index a8c9aa6bd..bfe6f5490 100644 --- a/wgengine/netstack/netstack.go +++ b/wgengine/netstack/netstack.go @@ -316,7 +316,7 @@ func (m DNSMap) Resolve(ctx context.Context, addr string) (netaddr.IPPort, error // Try MagicDNS first, else otherwise a real DNS lookup. ip := m[host] if !ip.IsZero() { - return netaddr.IPPort{IP: ip, Port: uint16(port16)}, nil + return ip.WithPort(uint16(port16)), nil } // No MagicDNS name so try real DNS. @@ -329,7 +329,7 @@ func (m DNSMap) Resolve(ctx context.Context, addr string) (netaddr.IPPort, error return netaddr.IPPort{}, fmt.Errorf("DNS lookup returned no results for %q", host) } ip, _ = netaddr.FromStdIP(ips[0]) - return netaddr.IPPort{IP: ip, Port: uint16(port16)}, nil + return ip.WithPort(uint16(port16)), nil } func (ns *Impl) DialContextTCP(ctx context.Context, addr string) (*gonet.TCPConn, error) { |
