summaryrefslogtreecommitdiff
path: root/source3/libads/dns.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-05-05 21:19:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:50 -0500
commitb62f60d736ebc99ca688d577d5f4987100744f2a (patch)
treee75e66ffc55db8ecab25b70b7ea91e7f88388e2c /source3/libads/dns.c
parent5c6d0f21b6948d2cfc781e4d52d851e7e7bc471d (diff)
downloadsamba-b62f60d736ebc99ca688d577d5f4987100744f2a.tar.gz
samba-b62f60d736ebc99ca688d577d5f4987100744f2a.tar.bz2
samba-b62f60d736ebc99ca688d577d5f4987100744f2a.zip
r15464: fix dns build breakage on IRIX and OpenBSD
(This used to be commit 43f5d09a164ae111807222bdcbef949206766097)
Diffstat (limited to 'source3/libads/dns.c')
-rw-r--r--source3/libads/dns.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/libads/dns.c b/source3/libads/dns.c
index 678124a5e9..7eeb915ecf 100644
--- a/source3/libads/dns.c
+++ b/source3/libads/dns.c
@@ -38,12 +38,17 @@
#define MAX_DNS_PACKET_SIZE 0xffff
-#ifndef NS_HFIXEDSZ
+#ifdef NS_HFIXEDSZ /* Bind 8/9 interface */
+# define C_IN ns_c_in
+# define T_A ns_t_a
+# define T_SRV ns_t_srv
+#else
# ifdef HFIXEDSZ
# define NS_HFIXEDSZ HFIXEDSZ
# else
-# define NS_HFIXEDSZ 12
+# define NS_HFIXEDSZ sizeof(HEADER)
# endif
+# define T_SRV 33
#endif
/*********************************************************************
@@ -160,7 +165,7 @@ static BOOL ads_dns_parse_rr_srv( TALLOC_CTX *ctx, uint8 *start, uint8 *end,
return False;
}
- if ( rr.type != ns_t_srv ) {
+ if ( rr.type != T_SRV ) {
DEBUG(1,("ads_dns_parse_rr_srv: Bad answer type (%d)\n", rr.type));
return False;
}
@@ -248,7 +253,7 @@ NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx, const char *name, struct dns_rr_sr
return NT_STATUS_NO_MEMORY;
}
- if ( (resp_len = res_query(name, ns_c_in, ns_t_srv, buffer, buf_len)) < 0 ) {
+ if ( (resp_len = res_query(name, C_IN, T_SRV, buffer, buf_len)) < 0 ) {
DEBUG(1,("ads_dns_lookup_srv: Failed to resolve %s (%s)\n", name, strerror(errno)));
TALLOC_FREE( buffer );
return NT_STATUS_UNSUCCESSFUL;
@@ -328,7 +333,7 @@ NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx, const char *name, struct dns_rr_sr
/* only interested in A records as a shortcut for having to come
back later and lookup the name */
- if ( (rr.type != ns_t_a) || (rr.rdatalen != 4) )
+ if ( (rr.type != T_A) || (rr.rdatalen != 4) )
continue;
for ( i=0; i<idx; i++ ) {