summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-10-19 12:57:55 +1100
committerAmitay Isaacs <amitay@samba.org>2014-10-25 03:21:04 +0200
commit1e5c14548c8d03f66aaa908654c94f36a94455f2 (patch)
tree93a6c2bfa3b7d5ab248a18cff022b44aebb9dafa
parent58334eb58ed2f11c6f212481b6be772d9f182810 (diff)
downloadsamba-1e5c14548c8d03f66aaa908654c94f36a94455f2.tar.gz
samba-1e5c14548c8d03f66aaa908654c94f36a94455f2.tar.xz
samba-1e5c14548c8d03f66aaa908654c94f36a94455f2.zip
s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net>
-rw-r--r--source4/dns_server/dlz_bind9.c2
-rw-r--r--source4/dns_server/dlz_minimal.h22
2 files changed, 10 insertions, 14 deletions
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index f663a2c1e8..29788dc768 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -853,7 +853,7 @@ static isc_result_t dlz_lookup_types(struct dlz_bind9_data *state,
/*
lookup one record
*/
-#ifdef BIND_VERSION_9_8
+#if DLZ_DLOPEN_VERSION == 1
_PUBLIC_ isc_result_t dlz_lookup(const char *zone, const char *name,
void *dbdata, dns_sdlzlookup_t *lookup)
#else
diff --git a/source4/dns_server/dlz_minimal.h b/source4/dns_server/dlz_minimal.h
index 98fb34e974..af0d6bc163 100644
--- a/source4/dns_server/dlz_minimal.h
+++ b/source4/dns_server/dlz_minimal.h
@@ -16,25 +16,21 @@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/*
- This header provides a minimal set of defines and typedefs needed
- for building an external DLZ module for bind9. When creating a new
- external DLZ driver, please copy this header into your own source
- tree.
- */
-typedef unsigned int isc_result_t;
#ifdef BIND_VERSION_9_8
-typedef bool isc_boolean_t;
+#define DLZ_DLOPEN_VERSION 1
+#elif BIND_VERSION_9_9
+#define DLZ_DLOPEN_VERSION 2
#else
-typedef int isc_boolean_t;
+#error Unsupported BIND version
#endif
-typedef uint32_t dns_ttl_t;
-#ifdef BIND_VERSION_9_8
-#define DLZ_DLOPEN_VERSION 1
+typedef unsigned int isc_result_t;
+#if DLZ_DLOPEN_VERSION == 1
+typedef bool isc_boolean_t;
#else
-#define DLZ_DLOPEN_VERSION 2
+typedef int isc_boolean_t;
#endif
+typedef uint32_t dns_ttl_t;
/* return this in flags to dlz_version() if thread safe */
#define DNS_SDLZFLAG_THREADSAFE 0x00000001U