Remove yet more uses of global_loadparm.
[jelmer/samba4-debian.git] / source / torture / ldap / cldapbench.c
index 9f860f98d91d42395f41398c3cb95a2a88a556ee..83e505e164ee0210b607d0304f17c6fe95e757ac 100644 (file)
@@ -24,6 +24,7 @@
 #include "libcli/cldap/cldap.h"
 #include "libcli/resolve/resolve.h"
 #include "torture/torture.h"
+#include "param/param.h"
 
 struct bench_state {
        int pass_count, fail_count;
@@ -50,7 +51,7 @@ static void request_handler(struct cldap_request *req)
 */
 static bool bench_cldap(struct torture_context *tctx, const char *address)
 {
-       struct cldap_socket *cldap = cldap_socket_init(tctx, NULL);
+       struct cldap_socket *cldap = cldap_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx));
        int num_sent=0;
        struct timeval tv = timeval_current();
        bool ret = true;
@@ -62,6 +63,7 @@ static bool bench_cldap(struct torture_context *tctx, const char *address)
 
        ZERO_STRUCT(search);
        search.in.dest_address = address;
+       search.in.dest_port     = lp_cldap_port(tctx->lp_ctx);
        search.in.acct_control = -1;
        search.in.version = 6;
 
@@ -114,7 +116,7 @@ bool torture_bench_cldap(struct torture_context *torture)
        make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL));
 
        /* do an initial name resolution to find its IP */
-       status = resolve_name(&name, torture, &address, event_context_find(torture));
+       status = resolve_name(lp_resolve_context(torture->lp_ctx), &name, torture, &address, event_context_find(torture));
        if (!NT_STATUS_IS_OK(status)) {
                printf("Failed to resolve %s - %s\n",
                       name.name, nt_errstr(status));