summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet.c2
-rw-r--r--source4/libnet/libnet.h3
-rw-r--r--source4/libnet/libnet_lookup.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c
index 05f18b42a5..53ebb9e34a 100644
--- a/source4/libnet/libnet.c
+++ b/source4/libnet/libnet.c
@@ -55,5 +55,7 @@ struct libnet_context *libnet_context_init(struct tevent_context *ev,
/* default buffer size for various operations requiring specifying a buffer */
ctx->samr.buf_size = 128;
+ ctx->server_address = NULL;
+
return ctx;
}
diff --git a/source4/libnet/libnet.h b/source4/libnet/libnet.h
index c1a2e3708b..7492b7337a 100644
--- a/source4/libnet/libnet.h
+++ b/source4/libnet/libnet.h
@@ -54,6 +54,9 @@ struct libnet_context {
struct tevent_context *event_ctx;
struct loadparm_context *lp_ctx;
+
+ /* if non-null then override the server address */
+ const char *server_address;
};
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 6b8ab6edd4..66750706d8 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -197,7 +197,7 @@ struct tevent_req *libnet_LookupDCs_send(struct libnet_context *ctx,
ZERO_STRUCT(finddcs_io);
finddcs_io.in.domain_name = io->in.domain_name;
finddcs_io.in.minimum_dc_flags = NBT_SERVER_LDAP | NBT_SERVER_DS | NBT_SERVER_WRITABLE;
-
+ finddcs_io.in.server_address = ctx->server_address;
req = finddcs_cldap_send(mem_ctx, &finddcs_io, ctx->resolve_ctx, ctx->event_ctx);
return req;