The Samba-Bugzilla – Bug 11282
IPv6 support is missing when determining FQDN during ADS join
Last modified: 2015-06-06 20:07:01 UTC
Created attachment 11072 [details]
Patch Add IPv6 support for determining FQDN during ADS join
The existing code uses gethostbyname() which is obsoleted and should not be used.
It can break ADS joins from IPv6-only member servers.
This patch uses getaddrinfo(). With the AI_CANONNAME flag set, getaddrinfo() returns the canonical name of the host (that is its FQDN) in the first addrinfo struct. It only puts the canonical name in the first addrinfo struct as there should only ever be one FQDN.
The bad news with using getaddrinfo() is that for it to work /etc/hosts must be formatted correctly. It is less forgiving than gethostbyname() and does not return all the aliases. As a result, the FQDN must come before any aliases in /etc/hosts. I have added additional DEBUG messages to catch this.
Created attachment 11095 [details]
git-am fix for 4.2.next.
Created attachment 11096 [details]
git-am fix for 4.1.next.
Re-assigning to Karolin for inclusion in 4.2.next, 4.1.next.
(In reply to Jeremy Allison from comment #3)
Pushed to autobuild-v4-[1|2]-test.
(In reply to Karolin Seeger from comment #4)
Pushed to both branches.
Closing out bug report.