rwrap: If we do not have ns_name_compress() use dn_comp().
authorAndreas Schneider <asn@samba.org>
Mon, 12 Jan 2015 16:32:45 +0000 (17:32 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 13 Jan 2015 15:57:10 +0000 (16:57 +0100)
This should fix older Linux versions which do not export
ns_name_compress(). In newer glibc versions dn_comp() calls
ns_name_compress().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11019

Reviewed-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/resolv_wrapper/resolv_wrapper.c
lib/resolv_wrapper/wscript

index 7211ad087a4bcb286a4cc162aee465d53748e849..c70ca64e92b7737e3cd5b972cd719fdb1352d20c 100644 (file)
 #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,
index 3aff4d1e597cb8f4dde99b68d4919014b9eb1f35..a84b1e97d7c43f009257f18e129e4ba721171bf2 100644 (file)
@@ -74,6 +74,8 @@ def configure(conf):
         conf.CHECK_FUNCS_IN('res_search __res_search', 'resolv', checklibc=True)
         conf.CHECK_FUNCS_IN('res_nsearch __res_nsearch', 'resolv', checklibc=True)
 
+        conf.CHECK_FUNCS_IN('ns_name_compress', 'resolv', checklibc=True)
+
         # Create full path to resolv_wrapper
         srcdir = os.path.realpath(conf.srcdir)
         libresolv_wrapper_so_path = srcdir + '/bin/default/lib/resolv_wrapper/libresolv-wrapper.so'