We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8afca6c commit cdecac1Copy full SHA for cdecac1
tailnet/conn.go
@@ -302,7 +302,17 @@ func (c *Conn) UpdateNodes(nodes []*Node) error {
302
for _, peer := range c.netMap.Peers {
303
if peerStatus, ok := status.Peer[peer.Key]; ok {
304
// Clear out inactive connections!
305
+ // If the connection hasn't been written to in a while, we manually
306
+ // send a ping to ensure it's still alive.
307
if !peerStatus.Active {
308
+ c.Ping(peer.Addresses[0].Addr(), tailcfg.PingDisco, func(pr *ipnstate.PingResult) {
309
+ if pr.Err != "" {
310
+ // If an error happened during ping (like no route to host),
311
+ // we omit it from being added to the map, and go on!
312
+ return
313
+ }
314
+ peerMap[peer.ID] = peer
315
+ })
316
continue
317
}
318
0 commit comments