summaryrefslogtreecommitdiff
path: root/source4/lib/socket
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/socket')
-rw-r--r--source4/lib/socket/connect.c15
-rw-r--r--source4/lib/socket/socket.h1
-rw-r--r--source4/lib/socket/socket_ipv4.c2
-rw-r--r--source4/lib/socket/socket_ipv6.c2
-rw-r--r--source4/lib/socket/socket_unix.c2
5 files changed, 17 insertions, 5 deletions
diff --git a/source4/lib/socket/connect.c b/source4/lib/socket/connect.c
index 567c8f41d2..bb4d7cc843 100644
--- a/source4/lib/socket/connect.c
+++ b/source4/lib/socket/connect.c
@@ -74,15 +74,20 @@ NTSTATUS socket_connect_ev(struct socket_context *sock,
{
TALLOC_CTX *tmp_ctx = talloc_new(sock);
NTSTATUS status;
-
+
/*
we resolve separately to ensure that the name resolutions happens
asynchronously
+
+ the check for ipv4 is ugly, but how to do it better? We don't want
+ to try to resolve unix pathnames here
*/
- status = connect_resolve(tmp_ctx, server_address, ev, &server_address);
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(tmp_ctx);
- return status;
+ if (strcmp(sock->backend_name, "ipv4") == 0) {
+ status = connect_resolve(tmp_ctx, server_address, ev, &server_address);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(tmp_ctx);
+ return status;
+ }
}
set_blocking(socket_get_fd(sock), False);
diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h
index 8645ba28bc..27a1dfe041 100644
--- a/source4/lib/socket/socket.h
+++ b/source4/lib/socket/socket.h
@@ -102,6 +102,7 @@ struct socket_context {
void *private_data;
const struct socket_ops *ops;
+ const char *backend_name;
};
diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c
index 0fc65698c4..9c393a77ec 100644
--- a/source4/lib/socket/socket_ipv4.c
+++ b/source4/lib/socket/socket_ipv4.c
@@ -46,6 +46,8 @@ static NTSTATUS ipv4_init(struct socket_context *sock)
return map_nt_error_from_unix(errno);
}
+ sock->backend_name = "ipv4";
+
return NT_STATUS_OK;
}
diff --git a/source4/lib/socket/socket_ipv6.c b/source4/lib/socket/socket_ipv6.c
index 58e35d87de..da3a69e81e 100644
--- a/source4/lib/socket/socket_ipv6.c
+++ b/source4/lib/socket/socket_ipv6.c
@@ -44,6 +44,8 @@ static NTSTATUS ipv6_tcp_init(struct socket_context *sock)
return map_nt_error_from_unix(errno);
}
+ sock->backend_name = "ipv6";
+
return NT_STATUS_OK;
}
diff --git a/source4/lib/socket/socket_unix.c b/source4/lib/socket/socket_unix.c
index 9c19aaace5..c5af48da0f 100644
--- a/source4/lib/socket/socket_unix.c
+++ b/source4/lib/socket/socket_unix.c
@@ -57,6 +57,8 @@ static NTSTATUS unixdom_init(struct socket_context *sock)
}
sock->private_data = NULL;
+ sock->backend_name = "unix";
+
return NT_STATUS_OK;
}