From: Andreas Schneider Date: Thu, 8 Jan 2015 15:32:19 +0000 (+0100) Subject: rwrap: If we do not have ns_name_compress() use dn_comp(). X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fcwrap%2Fresolv_wrapper.git;a=commitdiff_plain;h=2f37b07dec61f4e4aa92799c4b0857379619f266 rwrap: If we do not have ns_name_compress() use dn_comp(). This should fix older Linux versions which do not export ns_name_compress(). In newer glibc versions dn_comp() calls ns_name_compress(). Reviewed-by: Jakub Hrozek Reviewed-by: Michael Adam --- diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 41bed3a..a68959f 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -94,6 +94,8 @@ check_function_exists(__res_search HAVE___RES_SEARCH) check_function_exists(res_nsearch HAVE_RES_NSEARCH) check_function_exists(__res_nsearch HAVE___RES_NSEARCH) +check_function_exists(ns_name_compress HAVE_NS_NAME_COMPRESS) + if (UNIX) if (NOT LINUX) # libsocket (Solaris) diff --git a/config.h.cmake b/config.h.cmake index aad83e3..31e2855 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -44,6 +44,8 @@ #cmakedefine HAVE_RES_NSEARCH 1 #cmakedefine HAVE___RES_NSEARCH 1 +#cmakedefine HAVE_NS_NAME_COMPRESS 1 + /*************************** LIBRARIES ***************************/ #cmakedefine HAVE_LIBRESOLV 1 diff --git a/src/resolv_wrapper.c b/src/resolv_wrapper.c index 7211ad0..c70ca64 100644 --- a/src/resolv_wrapper.c +++ b/src/resolv_wrapper.c @@ -65,6 +65,10 @@ #define RWRAP_DEFAULT_FAKE_TTL 600 #endif /* RWRAP_DEFAULT_FAKE_TTL */ +#ifndef HAVE_NS_NAME_COMPRESS +#define ns_name_compress dn_comp +#endif + enum rwrap_dbglvl_e { RWRAP_LOG_ERROR = 0, RWRAP_LOG_WARN,