summaryrefslogtreecommitdiff
path: root/libcli/cldap
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-14 07:49:12 +1000
committerAndrew Tridgell <tridge@samba.org>2010-09-15 15:39:35 +1000
commit4ff452151a1d253b44cccfce034873c260ff414c (patch)
treea227b50296c4485a63aac440d0929416ee733ab3 /libcli/cldap
parentdbc9b185afa2fe59f73526b081ef6acff7d61aaa (diff)
downloadsamba-4ff452151a1d253b44cccfce034873c260ff414c.tar.gz
samba-4ff452151a1d253b44cccfce034873c260ff414c.tar.bz2
samba-4ff452151a1d253b44cccfce034873c260ff414c.zip
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.
Diffstat (limited to 'libcli/cldap')
-rw-r--r--libcli/cldap/cldap.c6
1 files changed, 5 insertions, 1 deletions
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) {