From 713cfa245ac909bc5892f16d49ddc1db173723bd Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Fri, 10 Feb 2012 22:10:32 -0700 Subject: [PATCH] Another try at OpenBSD fixes. nameser_compat.h is required on Darwin, but doesn't exist on OpenBSD. Also, OpenBSD doesn't support the ns_c_in or ns_t_srv enums, so the C_IN and T_SRV macros are required. --- configure.ac | 1 + src/sock.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7b9797c..8c0ca3c 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,7 @@ fi AC_MSG_NOTICE([libstrophe will use the $with_parser XML parser]) AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([res_9_query], [resolv]) +AC_CHECK_HEADERS([arpa/nameser_compat.h]) AM_CONDITIONAL([PARSER_EXPAT], [test x$with_parser != xlibxml2]) AC_SUBST(PARSER_NAME) diff --git a/src/sock.c b/src/sock.c index 5992719..d3f2798 100644 --- a/src/sock.c +++ b/src/sock.c @@ -35,6 +35,9 @@ #include #include #include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif #include #endif @@ -865,7 +868,7 @@ int sock_srv_lookup(const char *service, const char *proto, const char *domain, unsigned char buf[65535]; int len; - if ((len = res_query(fulldomain, ns_c_in, ns_t_srv, buf, 65535)) > 0) { + if ((len = res_query(fulldomain, C_IN, T_SRV, buf, 65535)) > 0) { int offset; int i; struct dnsquery_header header;