peerConfigLocked returns the set of peer nodes we have. c.L must be held.
()
| 240 | |
| 241 | // peerConfigLocked returns the set of peer nodes we have. c.L must be held. |
| 242 | func (c *configMaps) peerConfigLocked() []*tailcfg.Node { |
| 243 | out := make([]*tailcfg.Node, 0, len(c.peers)) |
| 244 | for _, p := range c.peers { |
| 245 | // Don't add nodes that we havent received a READY_FOR_HANDSHAKE for |
| 246 | // yet, if they're a destination. If we received a READY_FOR_HANDSHAKE |
| 247 | // for a peer before we receive their node, the node will be nil. |
| 248 | if (!p.readyForHandshake && p.isDestination) || p.node == nil { |
| 249 | continue |
| 250 | } |
| 251 | n := p.node.Clone() |
| 252 | if c.blockEndpoints { |
| 253 | n.Endpoints = nil |
| 254 | } |
| 255 | out = append(out, n) |
| 256 | } |
| 257 | return out |
| 258 | } |
| 259 | |
| 260 | func (c *configMaps) setTunnelDestination(id uuid.UUID) { |
| 261 | c.L.Lock() |