From 25f286fdfe0cf7ac800ccf3ac62ee5e1d2ceb583 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Dec 2007 16:20:29 +0100 Subject: [PATCH] r26223: Move loadparm context up in the stack. (This used to be commit 152e2b1a283675b53affb8f7225644925f171dbd) --- source4/libcli/cldap/cldap.c | 3 ++- source4/libcli/cldap/cldap.h | 1 + source4/libcli/dgram/browse.c | 3 ++- source4/libcli/dgram/libdgram.h | 1 + source4/torture/ldap/cldap.c | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c index 9903595dfb9..88421ad08d8 100644 --- a/source4/libcli/cldap/cldap.c +++ b/source4/libcli/cldap/cldap.c @@ -317,7 +317,7 @@ struct cldap_request *cldap_search_send(struct cldap_socket *cldap, req->dest = socket_address_from_strings(req, cldap->sock->backend_name, io->in.dest_address, - lp_cldap_port(global_loadparm)); + io->in.dest_port); if (!req->dest) goto failed; req->message_id = idr_get_new_random(cldap->idr, req, UINT16_MAX); @@ -572,6 +572,7 @@ struct cldap_request *cldap_netlogon_send(struct cldap_socket *cldap, if (filter == NULL) goto failed; search.in.dest_address = io->in.dest_address; + search.in.dest_port = lp_cldap_port(global_loadparm); search.in.filter = filter; search.in.attributes = attr; search.in.timeout = 2; diff --git a/source4/libcli/cldap/cldap.h b/source4/libcli/cldap/cldap.h index e957ccea19a..cdee775aa79 100644 --- a/source4/libcli/cldap/cldap.h +++ b/source4/libcli/cldap/cldap.h @@ -98,6 +98,7 @@ struct cldap_socket { struct cldap_search { struct { const char *dest_address; + uint16_t dest_port; const char *filter; const char **attributes; int timeout; diff --git a/source4/libcli/dgram/browse.c b/source4/libcli/dgram/browse.c index 3b5f67118f4..ab831df8ccb 100644 --- a/source4/libcli/dgram/browse.c +++ b/source4/libcli/dgram/browse.c @@ -56,6 +56,7 @@ NTSTATUS dgram_mailslot_browse_send(struct nbt_dgram_socket *dgmsock, NTSTATUS dgram_mailslot_browse_reply(struct nbt_dgram_socket *dgmsock, struct nbt_dgram_packet *request, const char *mailslot_name, + const char *my_netbios_name, struct nbt_browse_packet *reply) { NTSTATUS status; @@ -72,7 +73,7 @@ NTSTATUS dgram_mailslot_browse_reply(struct nbt_dgram_socket *dgmsock, return ndr_map_error2ntstatus(ndr_err); } - make_nbt_name_client(&myname, lp_netbios_name(global_loadparm)); + make_nbt_name_client(&myname, my_netbios_name); dest = socket_address_from_strings(tmp_ctx, dgmsock->sock->backend_name, request->src_addr, request->src_port); diff --git a/source4/libcli/dgram/libdgram.h b/source4/libcli/dgram/libdgram.h index 8165e445bcb..9f67d58ae26 100644 --- a/source4/libcli/dgram/libdgram.h +++ b/source4/libcli/dgram/libdgram.h @@ -154,6 +154,7 @@ NTSTATUS dgram_mailslot_browse_send(struct nbt_dgram_socket *dgmsock, NTSTATUS dgram_mailslot_browse_reply(struct nbt_dgram_socket *dgmsock, struct nbt_dgram_packet *request, const char *mailslot_name, + const char *my_netbios_name, struct nbt_browse_packet *reply); NTSTATUS dgram_mailslot_browse_parse(struct dgram_mailslot_handler *dgmslot, diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c index f258a1c32f6..a254a0ec091 100644 --- a/source4/torture/ldap/cldap.c +++ b/source4/torture/ldap/cldap.c @@ -26,6 +26,7 @@ #include "librpc/gen_ndr/ndr_nbt.h" #include "torture/torture.h" #include "lib/ldb/include/ldb.h" +#include "param/param.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ @@ -215,6 +216,7 @@ static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest) ZERO_STRUCT(search); search.in.dest_address = dest; + search.in.dest_port = lp_cldap_port(global_loadparm); search.in.timeout = 10; search.in.retries = 3; -- 2.34.1