wgengine/magicsock: make legacy DstToString match Addrs

DstToString is used in two places in wireguard-go: Logging and uapi.

We are switching to use uapi for wireguard-go config.
To preserve existing behavior, we need the full set of addrs.

And for logging, having the full set of addrs seems useful.

(The Addrs method itself is slated for removal. When that happens,
the implementation will move to DstToString.)


Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
pull/1147/head
Josh Bleecher Snyder 5 years ago committed by Josh Bleecher Snyder
parent 187e22a756
commit d3dd7c6270

@ -438,8 +438,7 @@ func (a *addrSet) DstToBytes() []byte {
return packIPPort(a.dst())
}
func (a *addrSet) DstToString() string {
dst := a.dst()
return dst.String()
return a.Addrs()
}
func (a *addrSet) DstIP() net.IP {
return a.dst().IP.IPAddr().IP // TODO: add netaddr accessor to cut an alloc here?

Loading…
Cancel
Save