winbindd: More simplification of cm_open_connection()
authorRalph Boehme <slow@samba.org>
Thu, 24 Nov 2022 11:17:32 +0000 (12:17 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 21 Dec 2022 19:10:35 +0000 (19:10 +0000)
commit0fcf00121afd0d67c3e0eee11f8490c32e2f58a7
tree2497025760657ac9e7445d28748b079d87c845fe
parent7315c5f4a5dd08216885f4a7588f57753de6038d
winbindd: More simplification of cm_open_connection()

This basically moves the functionality to connect the socket to the currently
preferred DC to a new helper function connect_preferred_dc() that is called from
the renamed function find_new_dc().

find_dc() now either returns a connected to the preferred DC or a new DC until
all possible DCs are exhausted and cm_open_connection() can just call find_dc()
to get a connected socket and pass it to cm_prepare_connection().

While at it reorder the args of find_dc() and make the only real out arg "fd"
the last one.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/winbindd_cm.c