From 4ff452151a1d253b44cccfce034873c260ff414c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 14 Sep 2010 07:49:12 +1000 Subject: cldap: use ipv4 not up for unbound cldap sockets If we use "ip" we end up with a PF_INET6 socket which breaks sendto() for v4 addresses. --- libcli/cldap/cldap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libcli/cldap/cldap.c') diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c index 896319e75c..33a1bd6571 100644 --- a/libcli/cldap/cldap.c +++ b/libcli/cldap/cldap.c @@ -320,7 +320,11 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx, c->event.ctx = ev; if (!local_addr) { - ret = tsocket_address_inet_from_strings(c, "ip", + /* we use ipv4 here instead of ip, as otherwise we end + up with a PF_INET6 socket, and sendto() for ipv4 + addresses will fail. That breaks cldap name + resolution for winbind to IPv4 hosts. */ + ret = tsocket_address_inet_from_strings(c, "ipv4", NULL, 0, &any); if (ret != 0) { -- cgit