summaryrefslogtreecommitdiff
path: root/source4/libcli/finddcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/finddcs.c')
-rw-r--r--source4/libcli/finddcs.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c
index 83bf9837f9..606809751e 100644
--- a/source4/libcli/finddcs.c
+++ b/source4/libcli/finddcs.c
@@ -28,7 +28,6 @@
#include "libcli/libcli.h"
#include "libcli/resolve/resolve.h"
#include "libcli/finddcs.h"
-#include "param/param.h"
struct finddcs_state {
struct composite_context *ctx;
@@ -43,6 +42,7 @@ struct finddcs_state {
int num_dcs;
struct nbt_dc_name *dcs;
+ uint16_t nbt_port;
};
static void finddcs_name_resolved(struct composite_context *ctx);
@@ -62,10 +62,11 @@ static void fallback_node_status_replied(struct nbt_name_request *name_req);
struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
const char *my_netbios_name,
+ uint16_t nbt_port,
const char *domain_name,
int name_type,
struct dom_sid *domain_sid,
- const char **methods,
+ struct resolve_context *resolve_ctx,
struct event_context *event_ctx,
struct messaging_context *msg_ctx)
{
@@ -82,6 +83,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
state->ctx = c;
+ state->nbt_port = nbt_port;
state->my_netbios_name = talloc_strdup(state, my_netbios_name);
state->domain_name = talloc_strdup(state, domain_name);
if (composite_nomem(state->domain_name, c)) return c;
@@ -96,7 +98,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
state->msg_ctx = msg_ctx;
make_nbt_name(&name, state->domain_name, name_type);
- creq = resolve_name_send(&name, event_ctx, methods);
+ creq = resolve_name_send(resolve_ctx, &name, event_ctx);
composite_continue(c, creq, finddcs_name_resolved, state);
return c;
}
@@ -177,7 +179,7 @@ static void finddcs_getdc_replied(struct irpc_request *ireq)
composite_done(state->ctx);
}
-/* The GetDC request might not be availible (such as occours when the
+/* The GetDC request might not be available (such as occours when the
* NBT server is down). Fallback to a node status. It is the best
* hope we have... */
static void fallback_node_status(struct finddcs_state *state)
@@ -189,6 +191,7 @@ static void fallback_node_status(struct finddcs_state *state)
state->node_status.in.name.type = NBT_NAME_CLIENT;
state->node_status.in.name.scope = NULL;
state->node_status.in.dest_addr = state->dcs[0].address;
+ state->node_status.in.dest_port = state->nbt_port;
state->node_status.in.timeout = 1;
state->node_status.in.retries = 2;
@@ -247,17 +250,19 @@ NTSTATUS finddcs_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
NTSTATUS finddcs(TALLOC_CTX *mem_ctx,
const char *my_netbios_name,
+ uint16_t nbt_port,
const char *domain_name, int name_type,
struct dom_sid *domain_sid,
- const char **methods,
+ struct resolve_context *resolve_ctx,
struct event_context *event_ctx,
struct messaging_context *msg_ctx,
int *num_dcs, struct nbt_dc_name **dcs)
{
struct composite_context *c = finddcs_send(mem_ctx,
my_netbios_name,
+ nbt_port,
domain_name, name_type,
- domain_sid, methods,
+ domain_sid, resolve_ctx,
event_ctx, msg_ctx);
return finddcs_recv(c, mem_ctx, num_dcs, dcs);
}