wgengine: fix race on endpoints in getStatus
Signed-off-by: James Tucker <james@tailscale.com>
(cherry picked from commit 265b008e49
)
pull/5574/head
parent
bd14112d0b
commit
78584a8552
|
@ -1005,6 +1005,7 @@ func (e *userspaceEngine) getStatus() (*Status, error) {
|
||||||
closing := e.closing
|
closing := e.closing
|
||||||
peerKeys := make([]key.NodePublic, len(e.peerSequence))
|
peerKeys := make([]key.NodePublic, len(e.peerSequence))
|
||||||
copy(peerKeys, e.peerSequence)
|
copy(peerKeys, e.peerSequence)
|
||||||
|
localAddrs := append([]tailcfg.Endpoint(nil), e.endpoints...)
|
||||||
e.mu.Unlock()
|
e.mu.Unlock()
|
||||||
|
|
||||||
if closing {
|
if closing {
|
||||||
|
@ -1020,7 +1021,7 @@ func (e *userspaceEngine) getStatus() (*Status, error) {
|
||||||
|
|
||||||
return &Status{
|
return &Status{
|
||||||
AsOf: time.Now(),
|
AsOf: time.Now(),
|
||||||
LocalAddrs: append([]tailcfg.Endpoint(nil), e.endpoints...),
|
LocalAddrs: localAddrs,
|
||||||
Peers: peers,
|
Peers: peers,
|
||||||
DERPs: derpConns,
|
DERPs: derpConns,
|
||||||
}, nil
|
}, nil
|
||||||
|
|
Loading…
Reference in New Issue