mirror of
https://github.com/tailscale/tailscale.git
synced 2025-06-11 02:08:36 +00:00
ipn/ipnstate: add home DERP to tailscale status JSON
Fixes #15625 Change-Id: Ic20dad2dab4ac52c666057845bdc3cf5c0ffcd8f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
6fb5e3b0cb
commit
476a4c6ff1
@ -53,6 +53,9 @@ type Status struct {
|
||||
// If nil, an exit node is not in use.
|
||||
ExitNodeStatus *ExitNodeStatus `json:"ExitNodeStatus,omitempty"`
|
||||
|
||||
// DERPHomeRegionID is the current home DERP region ID.
|
||||
DERPHomeRegionID int
|
||||
|
||||
// Health contains health check problems.
|
||||
// Empty means everything is good. (or at least that no known
|
||||
// problems are detected)
|
||||
|
@ -2892,11 +2892,15 @@ func (c *Conn) UpdateStatus(sb *ipnstate.StatusBuilder) {
|
||||
})
|
||||
}
|
||||
|
||||
c.foreachActiveDerpSortedLocked(func(node int, ad activeDerp) {
|
||||
// TODO(bradfitz): add a method to ipnstate.StatusBuilder
|
||||
// to include all the DERP connections we have open
|
||||
// and add it here. See the other caller of foreachActiveDerpSortedLocked.
|
||||
sb.MutateStatus(func(s *ipnstate.Status) {
|
||||
s.DERPHomeRegionID = c.myDerp
|
||||
c.foreachActiveDerpSortedLocked(func(node int, ad activeDerp) {
|
||||
// TODO(bradfitz): add a method to ipnstate.StatusBuilder
|
||||
// to include all the DERP connections we have open
|
||||
// and add it here. See the other caller of foreachActiveDerpSortedLocked.
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// SetStatistics specifies a per-connection statistics aggregator.
|
||||
|
Loading…
x
Reference in New Issue
Block a user