From: Armin Fisslthaler Date: Fri, 25 Apr 2014 12:44:06 +0000 (+0200) Subject: reload /etc/resolv.conf in SIGALRM handler X-Git-Tag: release-1.1pre11~101 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e76df30cb2af7a22e9c1dc91bb47a76c2fcbc43d;p=oweals%2Ftinc.git reload /etc/resolv.conf in SIGALRM handler --- diff --git a/configure.ac b/configure.ac index 4059f60..6ed4dd9 100644 --- a/configure.ac +++ b/configure.ac @@ -163,7 +163,7 @@ AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h time.h netpacket/packet.h], [], [], [#include "src/have.h"] ) -AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h], +AC_CHECK_HEADERS([netinet/if_ether.h netinet/ip.h netinet/ip6.h resolv.h], [], [], [#include "src/have.h"] ) AC_CHECK_HEADERS([netinet/tcp.h netinet/ip_icmp.h netinet/icmp6.h], @@ -204,6 +204,11 @@ AC_CHECK_DECLS([freeaddrinfo, gai_strerror, getaddrinfo, getnameinfo], [], [], [#include "src/have.h"] ) +AC_CHECK_DECLS([res_init], [], [], [ + #include + #include +]) + AC_CACHE_SAVE dnl These are defined in files in m4/ diff --git a/src/net.c b/src/net.c index 92f6be8..1e6b4c6 100644 --- a/src/net.c +++ b/src/net.c @@ -36,6 +36,10 @@ #include "subnet.h" #include "xalloc.h" +#ifdef HAVE_RESOLV_H +#include +#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