]> tinc-vpn.org Git - tinc/blobdiff - src/net.c
reload /etc/resolv.conf in SIGALRM handler
[tinc] / src / net.c
index 92f6be861d0d31539022770fecc165485d87a705..1e6b4c65318752696584d03c92d0173a27f56e54 100644 (file)
--- a/src/net.c
+++ b/src/net.c
 #include "subnet.h"
 #include "xalloc.h"
 
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
+
 int contradicting_add_edge = 0;
 int contradicting_del_edge = 0;
 static int sleeptime = 10;
@@ -309,6 +313,9 @@ static void sighup_handler(void *data) {
 
 static void sigalrm_handler(void *data) {
        logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s signal", strsignal(((signal_t *)data)->signum));
+#ifdef HAVE_DECL_RES_INIT
+       res_init();
+#endif
        retry();
 }
 #endif