chiark / gitweb /
mobile sites: Do not ever expire peer addresses
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Feb 2020 12:22:57 +0000 (12:22 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:55 +0000 (21:56 +0000)
For mobile sites, peer addresses come from our config or DNS name
lookup.  Ones that are not working now may work later in a different
network environment.  The mobile end is in charge of public path
selection so it needs to retain the information to try these
currently-non-working addresses.

In practice, this change allows me to switch backwards and forwards
between the FOSDEM v6-only wifi, and my v4-only USB stick.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c

diff --git a/site.c b/site.c
index df083f40948f1643863a49617b31257a64293a59..89e415c7ff7925b6b3a7caf3cbb9f2da28e1ab5e 100644 (file)
--- a/site.c
+++ b/site.c
@@ -2617,6 +2617,8 @@ static void transport_peers_debug(struct site *st, transport_peers *dst,
 
 static void transport_peers_expire(struct site *st, transport_peers *peers) {
     /* peers must be sorted first */
+    if (st->local_mobile) return;
+
     int previous_peers=peers->npeers;
     struct timeval oldest;
     oldest.tv_sec  = tv_now->tv_sec - st->mobile_peer_expiry;