summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_secondary.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-18 00:09:17 +0100
committerStefan Metzmacher <metze@samba.org>2008-12-18 13:32:51 +0100
commit4c2a113dd06ab2ba0b6faef781a7c21b4a2f3db0 (patch)
tree79b5e979ea938017560f4e61d38b1753b09f1224 /source4/librpc/rpc/dcerpc_secondary.c
parent4f5b8b68d550dd71c75f58e9895b585cc2155fc6 (diff)
downloadsamba-4c2a113dd06ab2ba0b6faef781a7c21b4a2f3db0.tar.gz
samba-4c2a113dd06ab2ba0b6faef781a7c21b4a2f3db0.tar.bz2
samba-4c2a113dd06ab2ba0b6faef781a7c21b4a2f3db0.zip
s4:librpc/rpc: remove we should not redo the name resolving for secondary tcp connections
metze
Diffstat (limited to 'source4/librpc/rpc/dcerpc_secondary.c')
-rw-r--r--source4/librpc/rpc/dcerpc_secondary.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c
index 8ac235c67c..1d76c65f40 100644
--- a/source4/librpc/rpc/dcerpc_secondary.c
+++ b/source4/librpc/rpc/dcerpc_secondary.c
@@ -31,13 +31,14 @@
#include "auth/credentials/credentials.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
-
+#include "lib/socket/socket.h"
struct sec_conn_state {
struct dcerpc_pipe *pipe;
struct dcerpc_pipe *pipe2;
struct dcerpc_binding *binding;
struct smbcli_tree *tree;
+ struct socket_address *peer_addr;
};
@@ -94,11 +95,17 @@ _PUBLIC_ struct composite_context* dcerpc_secondary_connection_send(struct dcerp
return c;
case NCACN_IP_TCP:
+ s->peer_addr = dcerpc_socket_peer_addr(s->pipe->conn, s);
+ if (!s->peer_addr) {
+ composite_error(c, NT_STATUS_INVALID_PARAMETER);
+ return c;
+ }
+
pipe_tcp_req = dcerpc_pipe_open_tcp_send(s->pipe2->conn,
- s->binding->host,
+ s->peer_addr->addr,
s->binding->target_hostname,
atoi(s->binding->endpoint),
- dcerpc_resolve_ctx(s->pipe->conn));
+ resolve_context_init(s));
composite_continue(c, pipe_tcp_req, continue_open_tcp, c);
return c;