diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-10-28 19:14:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:56 -0500 |
commit | 9f5c04c977c150b9e742ae625673b92c9a1acc54 (patch) | |
tree | 7d8d272334957334c30656cef26be71bb79acb15 | |
parent | bb69e3bbe62209b95f06d7d296b9c9015ab1c9b5 (diff) | |
download | samba-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)
-rw-r--r-- | source4/librpc/rpc/dcerpc_sock.c | 10 |
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); } /* |