]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Change to an early return in get_dc_list().
authorJeremy Allison <jra@samba.org>
Wed, 26 Aug 2020 19:07:18 +0000 (12:07 -0700)
committerNoel Power <npower@samba.org>
Mon, 7 Sep 2020 13:23:41 +0000 (13:23 +0000)
No logic change. Will make later code changes clearer.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/libsmb/namequery.c

index b41ef23164df559bc293714bc540508ce0cda924..f39c7382cffe8a97cbc7a4639c1e7fcd207d2096 100644 (file)
@@ -3782,15 +3782,16 @@ static NTSTATUS get_dc_list(const char *domain,
        p = pserver;
        while (next_token_talloc(frame, &p, &name, LIST_SEP)) {
                if (!done_auto_lookup && strequal(name, "*")) {
+                       done_auto_lookup = true;
                        status = internal_resolve_name(domain, auto_name_type,
                                                       sitename,
                                                       &auto_ip_list,
                                                       &auto_count,
                                                       resolve_order);
-                       if (NT_STATUS_IS_OK(status)) {
-                               num_addresses += auto_count;
+                       if (!NT_STATUS_IS_OK(status)) {
+                               continue;
                        }
-                       done_auto_lookup = true;
+                       num_addresses += auto_count;
                        DEBUG(8,("Adding %d DC's from auto lookup\n",
                                                auto_count));
                } else  {