Hello, after building Samba 3.5.0rc2 on Solaris 10 x86 with Sun Studio Compiler I got the following error: net ads testjoin [2010/02/12 19:18:21.589785, 0] utils/net_ads.c:285() ads_connect: No logon servers Join to domain is not valid: No logon servers [2010/02/12 19:18:21.590027, 2] utils/net.c:909() return code = -1 truss shows the following output: (...) 28019: write(2, " a d s _ t r y _ c o".., 85) = 85 28019: so_socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP, "", SOV_DEFAULT) = 7 28019: fcntl(7, F_GETFL) = 2 FWRITE 28019: fcntl(7, F_SETFL, FWRITE|FNONBLOCK) = 0 28019: fcntl(7, F_GETFD, 0x00000000) = 0 28019: fcntl(7, F_SETFD, 0x00000001) = 0 28019: connect(7, 0x08957368, 256, SOV_DEFAULT) Err#124 EAFNOSUPPORT 28019: AF_INET name = 183.201.245.15 port = 389 28019: close(7) = 0 28019: getuid() = 0 [0] (...) The Problem is, that the system opens an IPv6-Socket (which is wrong address family in this case) and then wants to connect on it with IPv4. After doing some research I found out that the problem is in "libcli/cldap/cldap.c". There is a test if an local-address is given: (...) if (!local_addr) { ret = tsocket_address_inet_from_strings(c, "ip", NULL, 0, &any); (...) tsock_address_inet_from_strings gives us an tsocket_address-struct with an IPv6 Address. (...) if (strcasecmp(fam, "ip") == 0) { hints.ai_family = AF_UNSPEC; if (!addr) { #ifdef HAVE_IPV6 addr = "::"; #else addr = "0.0.0.0"; #endif } } else if (strcasecmp(fam, "ipv4") == 0) { (...) after setting socket_address_inet_from_strings(c, "ip", to socket_address_inet_from_strings(c, "ipv4", (just to check if I'am on the right path) I got an "EINVAL" error from bind and connect in function tdgram_bsd_dgram_socket. The call to bind is: ret = bind(fd, &lbsda->u.sa, sa_socklen); sa_socklen is defined as sa_socklen = sizeof(lbsda->u.ss); shouldn't that better sa_socklen = sizeof(lbsda->u.sa); ? The call to connect is also called with sa_socketlen which also fails. To fix the IPv4 vs. IPv6 Problem I wrote a little function wich gives me u.sa.addr_family so I can decide if I want an IPv4 Address or not. I also wrote a patch to solve the sa_socklen-Problem. I hope both helps to fix the problem. Cheers, Ralf
Created attachment 5355 [details] Patches which may fix the issues There are 5 Patches in the Patchfile
I think this patch is the wrong way to fix this problem, I'll try to create a more generic fix for this tomorrow.
Created attachment 5366 [details] Patches for v3-5 Can you test this patches please?
I've tested the patch and it works. Thankyou!
Kai: please assign to Karolin once you've tested this patches. Karolin: please pick this patches before the patch from https://bugzilla.samba.org/show_bug.cgi?id=7115
Comment on attachment 5366 [details] Patches for v3-5 This works fine on my IPv6-only win2k8-r2 domain.
Karolin, please pick.
Pushed to v3-5-test. Closing out bug report. Thanks!