mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
s4:librpc/rpc: use dcerpc_binding_[g|set]_string_option("localaddress")
We should avoid deferencing struct dcerpc_binding if possible. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
e4b246a968
commit
91a367dce5
@ -383,10 +383,8 @@ static struct composite_context* dcerpc_pipe_connect_ncacn_ip_tcp_send(TALLOC_CT
|
||||
|
||||
/* store input parameters in state structure */
|
||||
s->io = *io;
|
||||
if (io->binding->localaddress != NULL) {
|
||||
s->localaddr = talloc_strdup(s, io->binding->localaddress);
|
||||
if (composite_nomem(s->localaddr, c)) return c;
|
||||
}
|
||||
s->localaddr = dcerpc_binding_get_string_option(io->binding,
|
||||
"localaddress");
|
||||
if (io->binding->host != NULL) {
|
||||
s->host = talloc_strdup(s, io->binding->host);
|
||||
if (composite_nomem(s->host, c)) return c;
|
||||
|
@ -38,6 +38,7 @@ struct sec_conn_state {
|
||||
struct dcerpc_pipe *pipe2;
|
||||
struct dcerpc_binding *binding;
|
||||
struct socket_address *peer_addr;
|
||||
const char *localaddress;
|
||||
};
|
||||
|
||||
|
||||
@ -93,8 +94,11 @@ _PUBLIC_ struct composite_context* dcerpc_secondary_connection_send(struct dcerp
|
||||
return c;
|
||||
}
|
||||
|
||||
s->localaddress = dcerpc_binding_get_string_option(s->binding,
|
||||
"localaddress");
|
||||
|
||||
pipe_tcp_req = dcerpc_pipe_open_tcp_send(s->pipe2->conn,
|
||||
s->binding->localaddress,
|
||||
s->localaddress,
|
||||
s->peer_addr->addr,
|
||||
s->binding->target_hostname,
|
||||
atoi(s->binding->endpoint),
|
||||
|
@ -225,6 +225,7 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
|
||||
struct epm_map_binding_state *s;
|
||||
struct composite_context *pipe_connect_req;
|
||||
struct cli_credentials *anon_creds;
|
||||
const char *localaddress;
|
||||
|
||||
NTSTATUS status;
|
||||
struct dcerpc_binding *epmapper_binding;
|
||||
@ -295,6 +296,13 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* basic endpoint mapping data */
|
||||
epmapper_binding->options = NULL;
|
||||
localaddress = dcerpc_binding_get_string_option(binding, "localaddress");
|
||||
if (localaddress != NULL) {
|
||||
c->status = dcerpc_binding_set_string_option(epmapper_binding,
|
||||
"localaddress",
|
||||
localaddress);
|
||||
if (!composite_is_ok(c)) return c;
|
||||
}
|
||||
epmapper_binding->flags = 0;
|
||||
epmapper_binding->assoc_group_id = 0;
|
||||
epmapper_binding->endpoint = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user