[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Dec 11 19:31:01 UTC 2020


The branch, master has been updated
       via  49256925996 libsmb: Remove unused ads_dns_query_* routines
       via  d327f664cc1 libsmb: Remove unused dns_lookup_list_async()
       via  9fa3ce29d6b test: test site-aware DC lookup via "net lookup ldap"
       via  b324e2e1a15 net: Use dns_rr_srv->ss_s in "net lookup ldap"
       via  ef8740ce896 net: Use ads_dns_query_srv() in net_lookup_ldap()
       via  61f71f34220 net: Add "sitename" support to "net lookup ldap"
       via  7614cce0bd6 libsmb: No need to call dns_lookup_list_async() in discover_dc_dns()
       via  9d7c048e0b1 libsmb: Use ads_dns_query_srv() in discover_dc_dns()
       via  d92a85fb121 libsmb: No need to call dns_lookup_list_async() in resolve_ads()
       via  b9f91571158 libsmb: Use ads_dns_query_srv() in resolve_ads()
       via  31d85404fc2 libcli: Add ads_dns_query_srv_send()/recv()
       via  60b96580d24 build: Wrap a long line
       via  18128188259 libcli: Add required #includes to dnsquery.h
       via  f25248fe676 libcli: Add required #includes to libcli/dns/dns.h
       via  aec02dc92b9 lib: Make dnsquery.h #ifdef align to our conventions
      from  4fa938e7e5f WHATSNEW: samba-tool gpo manage command

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 49256925996ff5db509364c1c47d0ecd8d79d757
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 20:21:21 2020 +0100

    libsmb: Remove unused ads_dns_query_* routines
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Dec 11 19:30:16 UTC 2020 on sn-devel-184

commit d327f664cc1e3216afdf3931e2719ba5aa63fce3
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 19:34:54 2020 +0100

    libsmb: Remove unused dns_lookup_list_async()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9fa3ce29d6b6280bb2c3ec6e3e30bbb65dbe6f57
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 4 20:00:28 2020 +0100

    test: test site-aware DC lookup via "net lookup ldap"
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b324e2e1a151f31d8b18298f25098eb77fe18610
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 2 21:18:04 2020 +0100

    net: Use dns_rr_srv->ss_s in "net lookup ldap"
    
    ads_dns_query_srv() always fills it
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ef8740ce89661281c8066583441c16261cd5eaae
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 19:17:30 2020 +0100

    net: Use ads_dns_query_srv() in net_lookup_ldap()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 61f71f3422086f4e2a9da85a0320c96d40383686
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 2 21:20:32 2020 +0100

    net: Add "sitename" support to "net lookup ldap"
    
    This will be used in a test later
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7614cce0bd654da7768ba93f50347513dcd95861
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 19:32:33 2020 +0100

    libsmb: No need to call dns_lookup_list_async() in discover_dc_dns()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9d7c048e0b1d74bea1fddd712df882445dc5aecc
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 19:13:46 2020 +0100

    libsmb: Use ads_dns_query_srv() in discover_dc_dns()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d92a85fb12167060bc2373a207fccfb57f9699a8
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 19:27:15 2020 +0100

    libsmb: No need to call dns_lookup_list_async() in resolve_ads()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b9f9157115869f397a8f284b4dda7151c3680281
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 19:02:31 2020 +0100

    libsmb: Use ads_dns_query_srv() in resolve_ads()
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 31d85404fc2b2e7d4c7d00ac0f8b78e30e3bc089
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 18:25:32 2020 +0100

    libcli: Add ads_dns_query_srv_send()/recv()
    
    This issues the "query" for SRV records site-aware and siteless. If
    there are SRV records returned without IP addresses, it will issue A
    and AAAA requests, waiting up to async_dns_timeout seconds. If that
    timeout is reached, ads_dns_query_srv_recv() returns whatever is
    around.
    
    Superdebug added by Jeremy <jra at samba.org> :-)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 60b96580d2415ea8048ea6b216cf764727d23879
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 18:04:12 2020 +0100

    build: Wrap a long line
    
    There will be one more .c file
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1812818825947fdbed7d9da343b7759a5eeffaf8
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 18:17:10 2020 +0100

    libcli: Add required #includes to dnsquery.h
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f25248fe676591c582d514e8c1a574c3f4b8699c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 18:16:30 2020 +0100

    libcli: Add required #includes to libcli/dns/dns.h
    
    Also, make it safe against being included twice
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit aec02dc92b92cd0487562105f7b01e3834550fa6
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 29 17:57:52 2020 +0100

    lib: Make dnsquery.h #ifdef align to our conventions
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/addns/dnsquery.c                    | 165 ---------
 lib/addns/dnsquery.h                    |  32 +-
 lib/addns/dnsquery_srv.c                | 560 +++++++++++++++++++++++++++++++
 lib/addns/dnsquery_srv.h                |  54 +++
 lib/addns/wscript_build                 |  11 +-
 libcli/dns/dns.h                        |   8 +
 source3/libsmb/dsgetdcname.c            | 200 ++---------
 source3/libsmb/namequery.c              | 575 ++------------------------------
 source3/libsmb/namequery.h              |   6 -
 source3/script/tests/test_net_lookup.sh |  48 +++
 source3/selftest/tests.py               |  12 +
 source3/utils/net_lookup.c              |  62 ++--
 12 files changed, 799 insertions(+), 934 deletions(-)
 create mode 100644 lib/addns/dnsquery_srv.c
 create mode 100644 lib/addns/dnsquery_srv.h
 create mode 100755 source3/script/tests/test_net_lookup.sh


Changeset truncated at 500 lines:

diff --git a/lib/addns/dnsquery.c b/lib/addns/dnsquery.c
index c73ee7b50f1..869d4597ee4 100644
--- a/lib/addns/dnsquery.c
+++ b/lib/addns/dnsquery.c
@@ -780,168 +780,3 @@ fail:
 	return status;
 }
 #endif
-
-/********************************************************************
- Query with optional sitename.
-********************************************************************/
-
-static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
-				       const char *servicename,
-				       const char *dc_pdc_gc_domains,
-				       const char *realm,
-				       const char *sitename,
-				       struct dns_rr_srv **dclist,
-				       size_t *numdcs )
-{
-	char *name;
-	NTSTATUS status;
-	size_t num_srvs = 0;
-
-	if ((sitename != NULL) && (strlen(sitename) != 0)) {
-		name = talloc_asprintf(ctx, "%s._tcp.%s._sites.%s._msdcs.%s",
-				       servicename, sitename,
-				       dc_pdc_gc_domains, realm);
-		if (name == NULL) {
-			return NT_STATUS_NO_MEMORY;
-		}
-
-		status = ads_dns_lookup_srv(ctx, name, dclist, &num_srvs);
-
-		TALLOC_FREE(name);
-
-		if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
-		    NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
-			return status;
-		}
-
-		if (NT_STATUS_IS_OK(status) && (num_srvs != 0)) {
-			goto done;
-		}
-	}
-
-	name = talloc_asprintf(ctx, "%s._tcp.%s._msdcs.%s",
-			       servicename, dc_pdc_gc_domains, realm);
-	if (name == NULL) {
-		return NT_STATUS_NO_MEMORY;
-	}
-	status = ads_dns_lookup_srv(ctx, name, dclist, &num_srvs);
-
-done:
-	*numdcs = num_srvs;
-	return status;
-}
-
-/********************************************************************
- Query for AD DC's.
-********************************************************************/
-
-NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
-			   const char *realm,
-			   const char *sitename,
-			   struct dns_rr_srv **dclist,
-			   size_t *numdcs )
-{
-	NTSTATUS status;
-
-	status = ads_dns_query_internal(ctx,
-					"_ldap",
-					"dc",
-					realm,
-					sitename,
-					dclist,
-					numdcs);
-	return status;
-}
-
-/********************************************************************
- Query for AD GC's.
-********************************************************************/
-
-NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
-			   const char *realm,
-			   const char *sitename,
-			   struct dns_rr_srv **dclist,
-			   size_t *numdcs )
-{
-	NTSTATUS status;
-
-	status = ads_dns_query_internal(ctx,
-					"_ldap",
-					"gc",
-					realm,
-					sitename,
-					dclist,
-					numdcs);
-	return status;
-}
-
-/********************************************************************
- Query for AD KDC's.
- Even if our underlying kerberos libraries are UDP only, this
- is pretty safe as it's unlikely that a KDC supports TCP and not UDP.
-********************************************************************/
-
-NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
-			    const char *dns_forest_name,
-			    const char *sitename,
-			    struct dns_rr_srv **dclist,
-			    size_t *numdcs )
-{
-	NTSTATUS status;
-
-	status = ads_dns_query_internal(ctx,
-					"_kerberos",
-					"dc",
-					dns_forest_name,
-					sitename,
-					dclist,
-					numdcs);
-	return status;
-}
-
-/********************************************************************
- Query for AD PDC. Sitename is obsolete here.
-********************************************************************/
-
-NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
-			   const char *dns_domain_name,
-			   struct dns_rr_srv **dclist,
-			   size_t *numdcs )
-{
-	return ads_dns_query_internal(ctx,
-				      "_ldap",
-				      "pdc",
-				      dns_domain_name,
-				      NULL,
-				      dclist,
-				      numdcs);
-}
-
-/********************************************************************
- Query for AD DC by guid. Sitename is obsolete here.
-********************************************************************/
-
-NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
-				const char *dns_forest_name,
-				const char *domain_guid,
-				struct dns_rr_srv **dclist,
-				size_t *numdcs )
-{
-	/*_ldap._tcp.DomainGuid.domains._msdcs.DnsForestName */
-
-	const char *domains;
-
-	/* little hack */
-	domains = talloc_asprintf(ctx, "%s.domains", domain_guid);
-	if (!domains) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	return ads_dns_query_internal(ctx,
-				      "_ldap",
-				      domains,
-				      dns_forest_name,
-				      NULL,
-				      dclist,
-				      numdcs);
-}
diff --git a/lib/addns/dnsquery.h b/lib/addns/dnsquery.h
index 777f1a7de6a..51f6b8ff87b 100644
--- a/lib/addns/dnsquery.h
+++ b/lib/addns/dnsquery.h
@@ -17,12 +17,14 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _ADS_DNS_H
-#define _ADS_DNS_H
+#ifndef __LIB_ADDNS_DNSQUERY_H__
+#define __LIB_ADDNS_DNSQUERY_H__
 
 #include "replace.h"
 #include <tevent.h>
 #include "libcli/dns/dns.h"
+#include "lib/util/util_net.h"
+#include "libcli/util/ntstatus.h"
 
 /* The following definitions come from libads/dns.c  */
 
@@ -79,28 +81,4 @@ NTSTATUS ads_dns_lookup_aaaa(TALLOC_CTX *ctx,
 			struct samba_sockaddr **addrs_out);
 #endif
 
-NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
-			   const char *realm,
-			   const char *sitename,
-			   struct dns_rr_srv **dclist,
-			   size_t *numdcs );
-NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
-			   const char *realm,
-			   const char *sitename,
-			   struct dns_rr_srv **dclist,
-			   size_t *numdcs );
-NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
-			    const char *dns_forest_name,
-			    const char *sitename,
-			    struct dns_rr_srv **dclist,
-			    size_t *numdcs );
-NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
-			   const char *dns_domain_name,
-			   struct dns_rr_srv **dclist,
-			   size_t *numdcs );
-NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
-				const char *dns_forest_name,
-				const char *domain_guid,
-				struct dns_rr_srv **dclist,
-				size_t *numdcs );
-#endif	/* _ADS_DNS_H */
+#endif	/* __LIB_ADDNS_DNSQUERY_H__ */
diff --git a/lib/addns/dnsquery_srv.c b/lib/addns/dnsquery_srv.c
new file mode 100644
index 00000000000..6cba22f32a2
--- /dev/null
+++ b/lib/addns/dnsquery_srv.c
@@ -0,0 +1,560 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "replace.h"
+#include "dnsquery.h"
+#include "dnsquery_srv.h"
+#include "lib/util/debug.h"
+#include "lib/util/tevent_ntstatus.h"
+#include "lib/util/talloc_stack.h"
+#include "lib/util/samba_util.h"
+#include "librpc/gen_ndr/dns.h"
+#include "librpc/ndr/libndr.h"
+
+/*
+ * For an array of dns_rr_srv records, issue A/AAAA queries for those
+ * records where the initial reply did not return IP addresses.
+ */
+
+struct dns_rr_srv_fill_state {
+	struct dns_rr_srv *srvs;
+	size_t num_srvs;
+
+	struct tevent_req **subreqs;
+	size_t num_outstanding;
+};
+
+static void dns_rr_srv_fill_done_a(struct tevent_req *subreq);
+#if defined(HAVE_IPV6)
+static void dns_rr_srv_fill_done_aaaa(struct tevent_req *subreq);
+#endif
+static void dns_rr_srv_fill_timedout(struct tevent_req *subreq);
+
+static struct tevent_req *dns_rr_srv_fill_send(
+	TALLOC_CTX *mem_ctx,
+	struct tevent_context *ev,
+	struct dns_rr_srv *srvs,
+	size_t num_srvs,
+	uint32_t timeout)
+{
+	struct tevent_req *req = NULL, *subreq = NULL;
+	struct dns_rr_srv_fill_state *state = NULL;
+	size_t i, num_subreqs;
+
+	req = tevent_req_create(mem_ctx, &state, struct dns_rr_srv_fill_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	state->srvs = srvs;
+	state->num_srvs = num_srvs;
+
+	/*
+	 * Without IPv6 we only use half of this, but who does not
+	 * have IPv6 these days?
+	 */
+	num_subreqs = num_srvs * 2;
+
+	state->subreqs = talloc_zero_array(
+		state, struct tevent_req *, num_subreqs);
+	if (tevent_req_nomem(state->subreqs, req)) {
+		return tevent_req_post(req, ev);
+	}
+
+	for (i=0; i<num_srvs; i++) {
+
+		if (srvs[i].hostname == NULL) {
+			continue;
+		}
+		if (srvs[i].ss_s != NULL) {
+			/* IP address returned in SRV record. */
+			continue;
+		}
+
+		subreq = ads_dns_lookup_a_send(
+			state->subreqs, ev, srvs[i].hostname);
+		if (tevent_req_nomem(subreq, req)) {
+			TALLOC_FREE(state->subreqs);
+			return tevent_req_post(req, ev);
+		}
+		tevent_req_set_callback(
+			subreq, dns_rr_srv_fill_done_a, req);
+
+		state->subreqs[i*2] = subreq;
+		state->num_outstanding += 1;
+
+#if defined(HAVE_IPV6)
+		subreq = ads_dns_lookup_aaaa_send(
+			state->subreqs, ev, srvs[i].hostname);
+		if (tevent_req_nomem(subreq, req)) {
+			TALLOC_FREE(state->subreqs);
+			return tevent_req_post(req, ev);
+		}
+		tevent_req_set_callback(
+			subreq, dns_rr_srv_fill_done_aaaa, req);
+
+		state->subreqs[i*2+1] = subreq;
+		state->num_outstanding += 1;
+#endif
+	}
+
+	if (state->num_outstanding == 0) {
+		tevent_req_done(req);
+		return tevent_req_post(req, ev);
+	}
+
+	subreq = tevent_wakeup_send(
+		state->subreqs,
+		ev,
+		tevent_timeval_current_ofs(timeout, 0));
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, dns_rr_srv_fill_timedout, req);
+
+	return req;
+}
+
+static void dns_rr_srv_fill_done(
+	struct tevent_req *subreq,
+	NTSTATUS (*recv_fn)(
+		struct tevent_req *req,
+		TALLOC_CTX *mem_ctx,
+		uint8_t *rcode_out,
+		size_t *num_names_out,
+		char ***hostnames_out,
+		struct samba_sockaddr **addrs_out))
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct dns_rr_srv_fill_state *state = tevent_req_data(
+		req, struct dns_rr_srv_fill_state);
+	size_t num_subreqs = talloc_array_length(state->subreqs);
+	struct dns_rr_srv *srv = NULL;
+	size_t num_ips;
+	struct sockaddr_storage *tmp = NULL;
+	uint8_t rcode = 0;
+	char **hostnames_out = NULL;
+	struct samba_sockaddr *addrs = NULL;
+	size_t num_addrs = 0;
+	NTSTATUS status;
+	size_t i;
+	const char *ip_dbg_str = (recv_fn == ads_dns_lookup_a_recv) ?
+				 "A" : "AAAA";
+
+	/*
+	 * This loop walks all potential subreqs. Typical setups won't
+	 * have more than a few DCs. If you have really many DCs
+	 * (hundreds) and a DNS that doesn't return the DC IPs in the
+	 * SRV reply, you have bigger problems than this loop linearly
+	 * walking a pointer array. This is theoretically O(n^2), but
+	 * probably the DNS roundtrip time outweights this by a
+	 * lot. And we have a global timeout on this whole
+	 * dns_rr_srv_fill routine.
+	 */
+	for (i=0; i<num_subreqs; i++) {
+		if (state->subreqs[i] == subreq) {
+			state->subreqs[i] = NULL;
+			break;
+		}
+	}
+	if (i == num_subreqs) {
+		tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+		return;
+	}
+
+	srv = &state->srvs[i/2]; /* 2 subreq per srv */
+
+	status = recv_fn(
+		subreq,
+		state,
+		&rcode,
+		&num_addrs,
+		&hostnames_out,
+		&addrs);
+	TALLOC_FREE(subreq);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		DBG_INFO("async DNS %s lookup for %s returned %s\n",
+			 ip_dbg_str,
+			 srv->hostname,
+			 nt_errstr(status));
+		num_addrs = 0;
+		goto done;
+	}
+
+	if (rcode != DNS_RCODE_OK) {
+		DBG_INFO("async DNS %s lookup for %s returned DNS code "
+			 "%"PRIu8"\n",
+			 ip_dbg_str,
+			 srv->hostname,
+			 rcode);
+		num_addrs = 0;
+		goto done;
+	}
+
+	if (num_addrs == 0) {
+		DBG_INFO("async DNS %s lookup for %s returned 0 addresses.\n",
+			 ip_dbg_str,
+			 srv->hostname);
+		goto done;
+	}
+
+	num_ips = talloc_array_length(srv->ss_s);
+
+	if (num_ips + num_addrs < num_addrs) {
+		/* overflow */
+		goto done;
+	}
+
+	tmp = talloc_realloc(
+		state->srvs,
+		srv->ss_s,
+		struct sockaddr_storage,
+		num_ips + num_addrs);
+	if (tmp == NULL) {
+		goto done;
+	}
+
+	for (i=0; i<num_addrs; i++) {
+		char addr[INET6_ADDRSTRLEN];
+		DBG_INFO("async DNS %s lookup for %s [%zu] got %s -> %s\n",
+			 ip_dbg_str,
+			 srv->hostname,
+			 i,
+			 hostnames_out[i],
+			 print_sockaddr(addr, sizeof(addr), &addrs[i].u.ss));
+		tmp[num_ips + i] = addrs[i].u.ss;
+	}
+	srv->ss_s = tmp;
+	srv->num_ips = num_ips + num_addrs;
+
+done:
+	state->num_outstanding -= 1;
+	if (state->num_outstanding == 0) {
+		tevent_req_done(req);
+	}
+}
+
+static void dns_rr_srv_fill_done_a(struct tevent_req *subreq)
+{
+	dns_rr_srv_fill_done(subreq, ads_dns_lookup_a_recv);
+}
+
+#if defined(HAVE_IPV6)
+static void dns_rr_srv_fill_done_aaaa(struct tevent_req *subreq)
+{
+	dns_rr_srv_fill_done(subreq, ads_dns_lookup_aaaa_recv);
+}
+#endif
+
+static void dns_rr_srv_fill_timedout(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct dns_rr_srv_fill_state *state = tevent_req_data(
+		req, struct dns_rr_srv_fill_state);
+	bool ok;
+
+	if (DEBUGLEVEL >= DBGLVL_INFO) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list