| 689 | } |
| 690 | |
| 691 | func (*configMaps) nodeKeepalive(lc *peerLifecycle, status *ipnstate.Status, node *tailcfg.Node) bool { |
| 692 | // If the peer is already active, keepalives should be enabled. |
| 693 | if peerStatus, statusOk := status.Peer[node.Key]; statusOk && peerStatus.Active { |
| 694 | return true |
| 695 | } |
| 696 | // If the peer is a destination, we should only enable keepalives if we've |
| 697 | // received the READY_FOR_HANDSHAKE. |
| 698 | if lc != nil && lc.isDestination && lc.readyForHandshake { |
| 699 | return true |
| 700 | } |
| 701 | |
| 702 | // If none of the above are true, keepalives should not be enabled. |
| 703 | return false |
| 704 | } |
| 705 | |
| 706 | type peerLifecycle struct { |
| 707 | peerID uuid.UUID |