Don't try to call res_init() if ./configure told us it doesn't exist.
[tinc] / src / net_setup.c
index a00a321..863616b 100644 (file)
@@ -1,7 +1,7 @@
 /*
     net_setup.c -- Setup.
     Copyright (C) 1998-2005 Ivo Timmermans,
-                  2000-2014 Guus Sliepen <guus@tinc-vpn.org>
+                  2000-2015 Guus Sliepen <guus@tinc-vpn.org>
                   2006      Scott Lamb <slamb@slamb.org>
                   2010      Brandon Black <blblack@gmail.com>
 
@@ -539,7 +539,12 @@ static bool setup_myself(void) {
 
 #if !defined(SOL_IP) || !defined(IP_TOS)
        if(priorityinheritance)
-               logger(LOG_WARNING, "%s not supported on this platform", "PriorityInheritance");
+               logger(LOG_WARNING, "%s not supported on this platform for IPv4 connection", "PriorityInheritance");
+#endif
+
+#if !defined(IPPROTO_IPV6) || !defined(IPV6_TCLASS)
+       if(priorityinheritance)
+               logger(LOG_WARNING, "%s not supported on this platform for IPv6 connection", "PriorityInheritance");
 #endif
 
        if(!get_config_int(lookup_config(config_tree, "MACExpire"), &macexpire))
@@ -808,6 +813,10 @@ static bool setup_myself(void) {
                        hint.ai_protocol = IPPROTO_TCP;
                        hint.ai_flags = AI_PASSIVE;
 
+#if HAVE_DECL_RES_INIT
+                       // ensure glibc reloads /etc/resolv.conf.
+                       res_init();
+#endif
                        err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai);
                        free(address);