summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-06 16:41:53 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:23 +0100
commit0f21c092d6c33fe22fef50fef013bdaa1b9b471b (patch)
tree4fe1761d73427fe6b977903e61d96ab2ba74eddd /source4
parentd378cf4c15e09b980f874bb103b28e89d9dd3a26 (diff)
downloadsamba-0f21c092d6c33fe22fef50fef013bdaa1b9b471b.tar.gz
samba-0f21c092d6c33fe22fef50fef013bdaa1b9b471b.tar.bz2
samba-0f21c092d6c33fe22fef50fef013bdaa1b9b471b.zip
r26311: Move port number specification higher up the call stack.
(This used to be commit ef946ff09315d90ea0419470ffd06a70498133f2)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/dgram/mailslot.c13
-rw-r--r--source4/torture/nbt/dgram.c6
2 files changed, 6 insertions, 13 deletions
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c
index 4e94e5ee5b..4f9d0bfc7c 100644
--- a/source4/libcli/dgram/mailslot.c
+++ b/source4/libcli/dgram/mailslot.c
@@ -150,27 +150,20 @@ NTSTATUS dgram_mailslot_send(struct nbt_dgram_socket *dgmsock,
enum dgram_msg_type msg_type,
const char *mailslot_name,
struct nbt_name *dest_name,
- struct socket_address *_dest,
+ struct socket_address *dest,
struct nbt_name *src_name,
DATA_BLOB *request)
{
TALLOC_CTX *tmp_ctx = talloc_new(dgmsock);
struct nbt_dgram_packet packet;
- struct socket_address *dest;
struct dgram_message *msg;
struct dgram_smb_packet *smb;
struct smb_trans_body *trans;
struct socket_address *src;
NTSTATUS status;
- if (_dest->port == 0) {
- dest = socket_address_from_strings(tmp_ctx, _dest->family,
- _dest->addr, lp_dgram_port(global_loadparm));
- } else {
- dest = _dest;
- }
- if (!dest) {
- return NT_STATUS_NO_MEMORY;
+ if (dest->port == 0) {
+ return NT_STATUS_INVALID_PARAMETER;
}
ZERO_STRUCT(packet);
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c
index f7a094b52d..e56d8c7500 100644
--- a/source4/torture/nbt/dgram.c
+++ b/source4/torture/nbt/dgram.c
@@ -124,7 +124,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx)
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, 0);
+ address, lp_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
@@ -204,7 +204,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, 0);
+ address, lp_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
@@ -323,7 +323,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, 0);
+ address, lp_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_ntlogon_send(dgmsock, DGRAM_DIRECT_UNIQUE,
&name, dest, &myname, &logon);