From 9426a655356f817f3d3174d25caa25224043d373 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 28 Oct 2004 19:14:26 +0000 Subject: [PATCH] r3330: Use IPv6 for RPC client connections if we can --- source/librpc/rpc/dcerpc_sock.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/librpc/rpc/dcerpc_sock.c b/source/librpc/rpc/dcerpc_sock.c index 819d5698b14..e1dca6a6d9f 100644 --- a/source/librpc/rpc/dcerpc_sock.c +++ b/source/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); } /*