namequery: correctly merge kdc ip address list
commit2f1b84719914f6e0966708da6cc8f4150f7c2608
authorUri Simchoni <urisimchoni@gmail.com>
Thu, 21 May 2015 07:38:42 +0000 (21 10:38 +0300)
committerJeremy Allison <jra@samba.org>
Mon, 15 Jun 2015 23:29:24 +0000 (16 01:29 +0200)
tree5466f0185ccbbc72a3ed694d5ba6f603fb310c1b
parent183b799103d250985807f187fe60a03deb2145cc
namequery: correctly merge kdc ip address list

When finding DCs, there are three sources of addresses:
1. "Last good server"
2. Configured password server
3. SRV DNS queries

Since those different sources may return the same addresses, the
IP list is checked for duplicates, e.g. in order to save on
the LDAP ping that usually follows. Both IP address and port are
compared.

This change fixes the address duplicate removal for the case of KDC
search, where the "last good server" or configured password server
also appears in the DNS SRV query response.

An (undocumented?) assumption is that the "password server" parameter
is applicable to KDCs as well, but if a port is specified (e.g.
dc1.example.com:390), then this is the ldap port.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/libsmb/namequery.c