ipn/ipnstate, wgengine/wgint: add handshake attempts accessors

Not yet used. This is being made available so magicsock/wgengine can
use it to ignore certain sends (UDP + DERP) later on at least mobile,
letting wireguard-go think it's doing its full attempt schedule, but
we can cut it short conditionally based on what we know from the
control plane.

Updates #7617

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: Ia367cf6bd87b2aeedd3c6f4989528acdb6773ca7
This commit is contained in:
Brad Fitzpatrick
2024-02-25 06:40:35 -08:00
committed by Brad Fitzpatrick
parent eb28818403
commit 1cf85822d0
4 changed files with 33 additions and 1 deletions

View File

@@ -196,6 +196,10 @@ type PeerStatusLite struct {
LastHandshake time.Time
// NodeKey is this peer's public node key.
NodeKey key.NodePublic
// HandshakeAttempts is how many failed attempts there have been at
// completing the current WireGuard handshake. This resets to zero on every
// successful handshake.
HandshakeAttempts uint32
}
// PeerStatus describes a peer node and its current state.