1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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
This commit is contained in:
Stefan Metzmacher 2011-07-22 11:54:03 +02:00
parent 7f0b4eed3b
commit 0cd70ec169
2 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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,