summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-22 11:54:03 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-22 17:06:08 +0200
commit0cd70ec169724c021bbae05432a02f0dbffd260f (patch)
treeeb0ee7d6ca0f7649cf9877b786ef74c9f5011be3 /source3
parent7f0b4eed3b85fd061351078e464586460745f225 (diff)
downloadsamba-0cd70ec169724c021bbae05432a02f0dbffd260f.tar.gz
samba-0cd70ec169724c021bbae05432a02f0dbffd260f.tar.bz2
samba-0cd70ec169724c021bbae05432a02f0dbffd260f.zip
s3:libsmb: let cli_connect_nb() only expect a const sockaddr_storage *dest_ss
Only one caller expects this value to be set, which now calls cli_state_remote_sockaddr() to get the value. metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cliconnect.c14
-rw-r--r--source3/libsmb/proto.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 6a7931b786..9742c266b0 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2839,7 +2839,7 @@ fail:
return status;
}
-NTSTATUS cli_connect_nb(const char *host, struct sockaddr_storage *pss,
+NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
uint16_t port, int name_type, const char *myname,
int signing_state, struct cli_state **pcli)
{
@@ -2864,8 +2864,8 @@ NTSTATUS cli_connect_nb(const char *host, struct sockaddr_storage *pss,
}
}
- status = cli_connect_sock(host, name_type, pss, myname, port, 20, &fd,
- &port);
+ status = cli_connect_sock(host, name_type, dest_ss, myname, port,
+ 20, &fd, &port);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
@@ -2875,10 +2875,6 @@ NTSTATUS cli_connect_nb(const char *host, struct sockaddr_storage *pss,
goto fail;
}
- if (pss != NULL) {
- *pss = cli->dest_ss;
- }
-
*pcli = cli;
status = NT_STATUS_OK;
fail:
@@ -2910,6 +2906,10 @@ NTSTATUS cli_start_connection(struct cli_state **output_cli,
return nt_status;
}
+ if (dest_ss != NULL) {
+ *dest_ss = *cli_state_remote_sockaddr(cli);;
+ }
+
if (flags & CLI_FULL_CONNECTION_DONT_SPNEGO)
cli->use_spnego = False;
else if (flags & CLI_FULL_CONNECTION_USE_KERBEROS)
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 623687cf11..1a57646457 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -76,7 +76,7 @@ struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct cli_state *cli);
NTSTATUS cli_negprot_recv(struct tevent_req *req);
-NTSTATUS cli_connect_nb(const char *host, struct sockaddr_storage *pss,
+NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
uint16_t port, int name_type, const char *myname,
int signing_state, struct cli_state **pcli);
NTSTATUS cli_start_connection(struct cli_state **output_cli,