summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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);
}
/*