projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f6543e4
)
Add an autoconf check for res_init().
author
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 25 Apr 2014 15:12:07 +0000
(17:12 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 25 Apr 2014 15:12:07 +0000
(17:12 +0200)
configure.ac
patch
|
blob
|
history
src/net.c
patch
|
blob
|
history
diff --git
a/configure.ac
b/configure.ac
index
1a5113f
..
000c7cf
100644
(file)
--- a/
configure.ac
+++ b/
configure.ac
@@
-158,7
+158,7
@@
dnl Checks for header files.
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
AC_HEADER_STDC
dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
AC_HEADER_STDC
-AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h])
+AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h
resolv.h
])
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 netpacket/packet.h],
[], [], [#include "src/have.h"]
)
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 netpacket/packet.h],
[], [], [#include "src/have.h"]
)
@@
-202,6
+202,11
@@
AC_CHECK_DECLS([freeaddrinfo, gai_strerror, getaddrinfo, getnameinfo],
[], [], [#include "src/have.h"]
)
[], [], [#include "src/have.h"]
)
+AC_CHECK_DECLS([res_init], [], [], [
+ #include <netinet/in.h>
+ #include <resolv.h>
+])
+
AC_CACHE_SAVE
dnl These are defined in files in m4/
AC_CACHE_SAVE
dnl These are defined in files in m4/
diff --git
a/src/net.c
b/src/net.c
index
392aa7a
..
fd79fdc
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-40,7
+40,10
@@
#include "route.h"
#include "subnet.h"
#include "xalloc.h"
#include "route.h"
#include "subnet.h"
#include "xalloc.h"
-#include "resolv.h"
+
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
bool do_purge = false;
volatile bool running = false;
bool do_purge = false;
volatile bool running = false;
@@
-495,7
+498,9
@@
int main_loop(void) {
avl_node_t *node;
logger(LOG_INFO, "Flushing event queue");
expire_events();
avl_node_t *node;
logger(LOG_INFO, "Flushing event queue");
expire_events();
+#ifdef HAVE_DECL_RES_INIT
res_init();
res_init();
+#endif
for(node = connection_tree->head; node; node = node->next) {
connection_t *c = node->data;
if(c->status.active)
for(node = connection_tree->head; node; node = node->next) {
connection_t *c = node->data;
if(c->status.active)