gsliepen / tinc

a VPN daemon
http://tinc-vpn.org/
Other
1.87k stars 280 forks source link

Improve the recently seen address cache. #373

Open gsliepen opened 2 years ago

gsliepen commented 2 years ago

Tinc supports storing the recently seen addresses of other nodes in an on-disk cache, so that even if their address doesn't match that in their host config files (or if their host config files don't contain Addresses at all), it can still reconnect to them. There are some issues though:

  1. The address cache is not enabled by default. Ensure the cache/ directory is created at init time.
  2. It seems we cache both UDP and TCP sockaddrs, but it probably only makes sense to store TCP ones.
  3. We should update the cache in more situations, like after a succesful join using an invitation, and when we update the graph and see a node becomes reachable.
  4. Integration tests should be added that check this functionality.