]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Merge PR 714: Avoid treat normal hosts as unresponsive servers.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 15 Jul 2022 06:51:31 +0000 (08:51 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 15 Jul 2022 06:51:31 +0000 (08:51 +0200)
  And fixup the lock code.

doc/Changelog
services/cache/infra.c

index ddefbde296cb9e4344267b18bccafd6f81049c4f..5ab369c68f332f7b25230bee5efa5047f8764ea6 100644 (file)
@@ -1,3 +1,7 @@
+15 July 2022: Wouter
+       - Merge PR 714: Avoid treat normal hosts as unresponsive servers.
+         And fixup the lock code.
+
 12 July 2022: George
        - For windows crosscompile, fix setting the IPV6_MTU socket option
          equivalent (IPV6_USER_MTU); allows cross compiling with latest
index 45fc7708f261871e05b39e32eb5d58340a0fa8fb..0461c815b86b6e3fc6c1fc6df67b5fa1e4a49e39 100644 (file)
@@ -723,18 +723,19 @@ infra_get_lame_rtt(struct infra_cache* infra,
        }
        /* expired entry */
        if(timenow > host->ttl) {
-               lock_rw_unlock(&e->lock);
 
                /* see if this can be a re-probe of an unresponsive server */
                /* minus 1000 because that is outside of the RTTBAND, so
                 * blacklisted servers stay blacklisted if this is chosen */
                if(host->rtt.rto >= USEFUL_SERVER_TOP_TIMEOUT) {
+                       lock_rw_unlock(&e->lock);
                        *rtt = USEFUL_SERVER_TOP_TIMEOUT-1000;
                        *lame = 0;
                        *dnsseclame = 0;
                        *reclame = 0;
                        return 1;
                }
+               lock_rw_unlock(&e->lock);
                return 0;
        }
        /* check lameness first */