mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-15 19:21:39 +00:00
ipn, wgengine/magicsock: fix tailscale status
display.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
891110e64c
commit
294ceb513c
10
ipn/local.go
10
ipn/local.go
@ -209,8 +209,14 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) {
|
||||
lastSeen = *p.LastSeen
|
||||
}
|
||||
var tailAddr string
|
||||
if len(p.Addresses) > 0 {
|
||||
tailAddr = strings.TrimSuffix(p.Addresses[0].String(), "/32")
|
||||
for _, addr := range p.Addresses {
|
||||
// The peer struct currently only allows a single
|
||||
// Tailscale IP address. For compatibility with the
|
||||
// old display, make sure it's the IPv4 address.
|
||||
if addr.IP.Is4() && addr.Mask == 32 && tsaddr.IsTailscaleIP(netaddr.IPFrom16(addr.IP.Addr)) {
|
||||
tailAddr = addr.IP.String()
|
||||
break
|
||||
}
|
||||
}
|
||||
sb.AddPeer(key.Public(p.Key), &ipnstate.PeerStatus{
|
||||
InNetworkMap: true,
|
||||
|
@ -2725,7 +2725,12 @@ func (c *Conn) UpdateStatus(sb *ipnstate.StatusBuilder) {
|
||||
continue
|
||||
}
|
||||
sb.AddTailscaleIP(ip)
|
||||
ss.TailAddr = ip.String()
|
||||
// TailAddr only allows for a single Tailscale IP. For
|
||||
// readability of `tailscale status`, make it the IPv4
|
||||
// address.
|
||||
if addr.IP.Is4() {
|
||||
ss.TailAddr = ip.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.SetSelfStatus(ss)
|
||||
|
Loading…
x
Reference in New Issue
Block a user