mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 16:11:23 +00:00
tailcfg: make Node.Hostinfo a HostinfoView
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -191,7 +191,7 @@ func peerDebugName(p *tailcfg.Node) string {
|
||||
if i := strings.Index(n, "."); i != -1 {
|
||||
return n[:i]
|
||||
}
|
||||
return p.Hostinfo.Hostname
|
||||
return p.Hostinfo.Hostname()
|
||||
}
|
||||
|
||||
func ipPortLess(a, b netaddr.IPPort) bool {
|
||||
|
@@ -901,7 +901,7 @@ func (c *Conn) Ping(peer *tailcfg.Node, res *ipnstate.PingResult, cb func(*ipnst
|
||||
}
|
||||
res.NodeName = peer.Name // prefer DNS name
|
||||
if res.NodeName == "" {
|
||||
res.NodeName = peer.Hostinfo.Hostname // else hostname
|
||||
res.NodeName = peer.Hostinfo.Hostname() // else hostname
|
||||
} else {
|
||||
if i := strings.Index(res.NodeName, "."); i != -1 {
|
||||
res.NodeName = res.NodeName[:i]
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
func nodeDebugName(n *tailcfg.Node) string {
|
||||
name := n.Name
|
||||
if name == "" {
|
||||
name = n.Hostinfo.Hostname
|
||||
name = n.Hostinfo.Hostname()
|
||||
}
|
||||
if i := strings.Index(name, "."); i != -1 {
|
||||
name = name[:i]
|
||||
|
Reference in New Issue
Block a user