From cb9cccebb8d74a573a131ac6794542881f9a7d38 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 27 Jul 2019 00:49:40 +0200 Subject: [PATCH] Ignore online/offline state from Catta. Catta only works on Ethernet interfaces. However, if there is a non-Ethernet interface, MeshLink might still be able to connect to peers. So just rely on getifaddrs() for checking whether to terminate connections or not. --- src/meshlink.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/meshlink.c b/src/meshlink.c index b1f5c918..4a4d3c65 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -3091,18 +3091,13 @@ end: } void handle_network_change(meshlink_handle_t *mesh, bool online) { + (void)online; + if(!mesh->connections) { return; } - if(online) { - retry(mesh); - } else { - // We are off-line. Terminate all active connections. - for list_each(connection_t, c, mesh->connections) { - terminate_connection(mesh, c, false); - } - } + retry(mesh); } static void __attribute__((constructor)) meshlink_init(void) { -- 2.39.5