mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 18:11:59 +00:00
wgengine: only launch pingers for peers predating the discovery protocol
Peers advertising a discovery key know how to speak the discovery protocol and do their own heartbeats to get through NATs and keep NATs open. No need for the pinger except for with legacy peers.
This commit is contained in:
@@ -528,6 +528,14 @@ func (c *Conn) DiscoPublicKey() tailcfg.DiscoKey {
|
||||
return c.discoPublic
|
||||
}
|
||||
|
||||
// PeerHasDiscoKey reports whether peer k supports discovery keys (client version 0.100.0+).
|
||||
func (c *Conn) PeerHasDiscoKey(k tailcfg.NodeKey) bool {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
_, ok := c.discoOfNode[k]
|
||||
return ok
|
||||
}
|
||||
|
||||
// c.mu must NOT be held.
|
||||
func (c *Conn) setNearestDERP(derpNum int) (wantDERP bool) {
|
||||
c.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user