summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-12-01 08:56:57 +0100
committerMichael Adam <obnox@samba.org>2012-12-02 23:19:28 +0100
commitc4d51d8d17f04583868f1fdc82322b26bcb1c7a0 (patch)
treea89f216ad3604b506b30f0e4a9366a20638cc6b2 /source4
parent0e2e3ff5e864115495be68040959838e2835e260 (diff)
downloadsamba-c4d51d8d17f04583868f1fdc82322b26bcb1c7a0.tar.gz
samba-c4d51d8d17f04583868f1fdc82322b26bcb1c7a0.tar.bz2
samba-c4d51d8d17f04583868f1fdc82322b26bcb1c7a0.zip
s4:libcli/finddcs_cldap: try all NBT#1C addresses
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/finddcs_cldap.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source4/libcli/finddcs_cldap.c b/source4/libcli/finddcs_cldap.c
index 38e828fa98..a7162f81ca 100644
--- a/source4/libcli/finddcs_cldap.c
+++ b/source4/libcli/finddcs_cldap.c
@@ -53,7 +53,7 @@ static bool finddcs_cldap_nbt_lookup(struct finddcs_cldap_state *state,
struct finddcs *io,
struct resolve_context *resolve_ctx,
struct tevent_context *event_ctx);
-static void finddcs_cldap_name_resolved(struct composite_context *ctx);
+static void finddcs_cldap_nbt_resolved(struct composite_context *ctx);
static void finddcs_cldap_next_server(struct finddcs_cldap_state *state);
static bool finddcs_cldap_ipaddress(struct finddcs_cldap_state *state, struct finddcs *io);
@@ -200,7 +200,7 @@ static bool finddcs_cldap_nbt_lookup(struct finddcs_cldap_state *state,
if (tevent_req_nomem(creq, state->req)) {
return false;
}
- creq->async.fn = finddcs_cldap_name_resolved;
+ creq->async.fn = finddcs_cldap_nbt_resolved;
creq->async.private_data = state;
return true;
}
@@ -315,27 +315,23 @@ static void finddcs_cldap_netlogon_replied(struct tevent_req *subreq)
/*
handle NBT name lookup reply
*/
-static void finddcs_cldap_name_resolved(struct composite_context *ctx)
+static void finddcs_cldap_nbt_resolved(struct composite_context *ctx)
{
struct finddcs_cldap_state *state =
talloc_get_type(ctx->async.private_data, struct finddcs_cldap_state);
- const char *address;
NTSTATUS status;
+ unsigned i;
- status = resolve_name_recv(ctx, state, &address);
+ status = resolve_name_multiple_recv(ctx, state, &state->srv_addresses);
if (tevent_req_nterror(state->req, status)) {
DEBUG(2,("finddcs: No matching NBT <1c> server found\n"));
return;
}
- DEBUG(4,("finddcs: Found NBT <1c> server at %s\n", address));
-
- state->srv_addresses = talloc_array(state, const char *, 2);
- if (tevent_req_nomem(state->srv_addresses, state->req)) {
- return;
+ for (i=0; state->srv_addresses[i]; i++) {
+ DEBUG(4,("finddcs: NBT <1c> response %u at '%s'\n",
+ i, state->srv_addresses[i]));
}
- state->srv_addresses[0] = address;
- state->srv_addresses[1] = NULL;
state->srv_address_index = 0;