The following Python code fails to loook through all AD DCs advertised in the SRV DNS records: netrc = net.Net(creds=self._creds, lp=self._parm) finddc_error = None result = None try: result = netrc.finddc(domain=domain, flags=nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_GC | nbt.NBT_SERVER_CLOSEST) except RuntimeError, e: try: # If search of closest GC failed, attempt to find any one result = netrc.finddc(domain=domain, flags=nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_GC) except RuntimeError, e: finddc_error = e The reason why it fails, is because out of, say, 4 addresses, two are IPv6 and IPv6 networking is not fully configured -- IPv6 stack is enabled but not really routed, and the code in finddcs_cldap.c does not handle the failure of creating a socket or sending the CLDAP ping and never getting to the reply.
Created attachment 11074 [details] Proposed patch Proposed patch attached. Note that the bug https://bugzilla.samba.org/show_bug.cgi?id=9618 may have a similar cause.
Created attachment 11076 [details] Patch for v4-2-test
Created attachment 11077 [details] Patch for v4-1-test
Comment on attachment 11076 [details] Patch for v4-2-test Looks fine.
Comment on attachment 11077 [details] Patch for v4-1-test Looks fine as well
Re-assigning to Karolin for inclusion in 4.2.next, 4.1.next.
Pushed to autobuild-v4-[1|2]-test.
(In reply to Karolin Seeger from comment #7) Pushed to both branches. Closing out bug report. Thanks!