r18533: Ensure we clear out the failed connection cache for an entire
authorJeremy Allison <jra@samba.org>
Thu, 14 Sep 2006 16:37:13 +0000 (16:37 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:51:48 +0000 (11:51 -0500)
domain when going back online.
Jeremy.
(This used to be commit c7e4c8d0b4d109ec67d4424dd446b74b55246c72)

source3/libsmb/conncache.c
source3/nsswitch/winbindd_dual.c

index 49512d7a2e58ec24d1eae804add4ad3de90f92de..b8ddcb2ba91e6409e2e1ab32c76a887a69d50c81 100644 (file)
@@ -162,3 +162,31 @@ void flush_negative_conn_cache( void )
        }
 
 }
+
+/****************************************************************************
+ Remove all negative entries for a domain. Used when going to online state in
+ winbindd.
+****************************************************************************/
+void flush_negative_conn_cache_for_domain(const char *domain)
+{
+       struct failed_connection_cache *fcc;
+       
+       fcc = failed_connection_cache;
+
+       while (fcc) {
+               struct failed_connection_cache *fcc_next;
+
+               fcc_next = fcc->next;
+
+               if (strequal(fcc->domain_name, domain)) {
+                       DEBUG(10,("flush_negative_conn_cache_for_domain: removed server %s "
+                               " from failed cache for domain %s\n",
+                               fcc->controller, domain));
+                       DLIST_REMOVE(failed_connection_cache, fcc);
+                       free(fcc);
+               }
+
+               fcc = fcc_next;
+       }
+}
index db21132a80ddb2b06297456be7cb0c6b53caf53a..659242e918b998122d576674c20b70ae9448c76e 100644 (file)
@@ -584,9 +584,9 @@ static void child_msg_offline(int msg_type, struct process_id src, void *buf, si
 
 static void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain)
 {
-       check_negative_conn_cache_timeout(domain->name, domain->dcname, 0);
+       flush_negative_conn_cache_for_domain(domain->name);
        if (*domain->alt_name) {
-               check_negative_conn_cache_timeout(domain->alt_name, domain->dcname, 0);
+               flush_negative_conn_cache_for_domain(domain->alt_name);
        }
 }