diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-09-23 19:50:00 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-09-25 10:38:45 -0700 |
commit | 805d9425c2ee06e1695e451500d1ffbf90ca8e72 (patch) | |
tree | 3bcdb29be6f57fd2cc0b54a9744d00b8c793d683 /source4/libnet | |
parent | a360428588467c29e8eb40b27a9db525d4c2ea96 (diff) | |
download | samba-805d9425c2ee06e1695e451500d1ffbf90ca8e72.tar.gz samba-805d9425c2ee06e1695e451500d1ffbf90ca8e72.tar.bz2 samba-805d9425c2ee06e1695e451500d1ffbf90ca8e72.zip |
s4-libnet: added server_address option in libnet context
this is used by libnet_LookupDCs
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet.h | 3 | ||||
-rw-r--r-- | source4/libnet/libnet_lookup.c | 2 |
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; |