From: Guus Sliepen <guus@tinc-vpn.org>
Date: Fri, 15 Jan 2010 22:19:08 +0000 (+0100)
Subject: Ping nodes immediately when receiving SIGALRM.
X-Git-Tag: release-1.0.12~12
X-Git-Url: http://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=51099658c919794cde72ea1107b9d9b9c3cee926;p=tinc

Ping nodes immediately when receiving SIGALRM.

One reason to send the ALRM signal is to let tinc immediately try to connect to
outgoing nodes, for example when PPP or DHCP configuration of the outgoing
interface finished.  Conversely, when the outgoing interface goes down one can
now send this signal to let tinc quickly detect that links are down too.
---

diff --git a/src/net.c b/src/net.c
index 3f17083c..9b60a314 100644
--- a/src/net.c
+++ b/src/net.c
@@ -418,8 +418,13 @@ int main_loop(void) {
 		}
 
 		if(sigalrm) {
+			avl_node_t *node;
 			logger(LOG_INFO, "Flushing event queue");
 			expire_events();
+			for(node = connection_tree->head; node; node = node->next) {
+				connection_t *c = node->data;
+				send_ping(c);
+			}
 			sigalrm = false;
 		}