summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_connect.c
diff options
context:
space:
mode:
authorJulien Kerihuel <j.kerihuel@openchange.org>2010-08-27 14:04:07 +0200
committerAndrew Tridgell <tridge@samba.org>2010-09-07 09:55:14 +1000
commite5e5a1110fb4092a1221512627b1f9d03ec8839c (patch)
treeabdc1fe26c4a6199494b12dca4e80b97e3f75dd1 /source4/librpc/rpc/dcerpc_connect.c
parent35aed17b2651bc6dd9be415f8b8060357ee78ecb (diff)
downloadsamba-e5e5a1110fb4092a1221512627b1f9d03ec8839c.tar.gz
samba-e5e5a1110fb4092a1221512627b1f9d03ec8839c.tar.bz2
samba-e5e5a1110fb4092a1221512627b1f9d03ec8839c.zip
Add unique IP address binding for client connections (EPM and ncacn_ip_tcp levels)
This allows for binding strings like this: ncacn_ip_tcp:host[localaddress=192.168.2.1,seal] which will force the connection to be locally bound to the specified IP address Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/librpc/rpc/dcerpc_connect.c')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 7779d31f99..0f3a86256c 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -276,6 +276,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np_smb2_recv(struct composite_context
struct pipe_ip_tcp_state {
struct dcerpc_pipe_connect io;
+ const char *localaddr;
const char *host;
const char *target_hostname;
uint32_t port;
@@ -319,13 +320,14 @@ static struct composite_context* dcerpc_pipe_connect_ncacn_ip_tcp_send(TALLOC_CT
/* store input parameters in state structure */
s->io = *io;
+ s->localaddr = talloc_reference(c, io->binding->localaddress);
s->host = talloc_reference(c, io->binding->host);
s->target_hostname = talloc_reference(c, io->binding->target_hostname);
/* port number is a binding endpoint here */
s->port = atoi(io->binding->endpoint);
/* send pipe open request on tcp/ip */
- pipe_req = dcerpc_pipe_open_tcp_send(s->io.pipe->conn, s->host, s->target_hostname,
+ pipe_req = dcerpc_pipe_open_tcp_send(s->io.pipe->conn, s->localaddr, s->host, s->target_hostname,
s->port, io->resolve_ctx);
composite_continue(c, pipe_req, continue_pipe_open_ncacn_ip_tcp, c);
return c;