summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-10-28 19:14:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:56 -0500
commit9f5c04c977c150b9e742ae625673b92c9a1acc54 (patch)
tree7d8d272334957334c30656cef26be71bb79acb15 /source4/librpc
parentbb69e3bbe62209b95f06d7d296b9c9015ab1c9b5 (diff)
downloadsamba-9f5c04c977c150b9e742ae625673b92c9a1acc54.tar.gz
samba-9f5c04c977c150b9e742ae625673b92c9a1acc54.tar.bz2
samba-9f5c04c977c150b9e742ae625673b92c9a1acc54.zip
r3330: Use IPv6 for RPC client connections if we can
(This used to be commit 9426a655356f817f3d3174d25caa25224043d373)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index 819d5698b1..e1dca6a6d9 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -361,7 +361,15 @@ static NTSTATUS dcerpc_pipe_open_socket(struct dcerpc_pipe **p,
*/
NTSTATUS dcerpc_pipe_open_tcp(struct dcerpc_pipe **p, const char *server, uint32_t port)
{
- return dcerpc_pipe_open_socket(p, server, port, "ip", NCACN_IP_TCP);
+ NTSTATUS status;
+
+ /* Try IPv6 first */
+ status = dcerpc_pipe_open_socket(p, server, port, "ipv6", NCACN_IP_TCP);
+ if (NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return dcerpc_pipe_open_socket(p, server, port, "ipv4", NCACN_IP_TCP);
}
/*