mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-06 04:42:42 +00:00
ipn: update AddPeer to include TaildropTarget (#15091)
We previously were not merging in the TaildropTarget into the PeerStatus because we did not update AddPeer. Updates tailscale/tailscale#14393 Signed-off-by: kari-ts <kari@tailscale.com>
This commit is contained in:
@@ -216,6 +216,11 @@ type PeerStatusLite struct {
|
||||
}
|
||||
|
||||
// PeerStatus describes a peer node and its current state.
|
||||
// WARNING: The fields in PeerStatus are merged by the AddPeer method in the StatusBuilder.
|
||||
// When adding a new field to PeerStatus, you must update AddPeer to handle merging
|
||||
// the new field. The AddPeer function is responsible for combining multiple updates
|
||||
// to the same peer, and any new field that is not merged properly may lead to
|
||||
// inconsistencies or lost data in the peer status.
|
||||
type PeerStatus struct {
|
||||
ID tailcfg.StableNodeID
|
||||
PublicKey key.NodePublic
|
||||
@@ -533,6 +538,9 @@ func (sb *StatusBuilder) AddPeer(peer key.NodePublic, st *PeerStatus) {
|
||||
if v := st.Capabilities; v != nil {
|
||||
e.Capabilities = v
|
||||
}
|
||||
if v := st.TaildropTarget; v != TaildropTargetUnknown {
|
||||
e.TaildropTarget = v
|
||||
}
|
||||
e.Location = st.Location
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user