]> git.ipfire.org Git - thirdparty/samba.git/commit
dsgetdcname: do not assume local system uses IPv4
authorNathaniel W. Turner <nturner@exagrid.com>
Fri, 23 Sep 2022 20:37:46 +0000 (16:37 -0400)
committerJeremy Allison <jra@samba.org>
Thu, 9 Mar 2023 19:12:15 +0000 (19:12 +0000)
commitf55a357c6b9387883a7628a1b1083263a10121a6
tree223b224a7382534d096c24a2e637ec8c9306cdd7
parent9bb8795aebdaad10713c791e45f11e3a4b94d5ff
dsgetdcname: do not assume local system uses IPv4

Return the first IPv4 and the first IPv6 address found for each DC.
This is slightly inelegant, but resolves an issue where IPv6-only
systems were unable to run "net ads join" against domain controllers
that have both A and AAAA records in DNS.

While this impacts performance due to the additional LDAP ping attempts,
in practice an attempt to connect to an IPv6 address on an IPv4-only
system (or vice versa) will fail immediately with
NT_STATUS_NETWORK_UNREACHABLE, and thus the performance impact should be
negligible.

The alternative approach, using an smb.conf setting to control whether
the logic prefers a single address of one family or the other ends up
being a bit awkward, as it pushes the problem onto admins and tools such
as "realm join" that want to dynamically synthesize an smb.conf on the
fly.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15325

Signed-off-by: Nathaniel W. Turner <nturner@exagrid.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar  9 19:12:15 UTC 2023 on atb-devel-224
source3/libsmb/dsgetdcname.c