]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to create and destroy rpz_lock in auth_zones structure.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 6 Feb 2020 10:51:17 +0000 (11:51 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 6 Feb 2020 10:51:17 +0000 (11:51 +0100)
doc/Changelog
services/authzone.c

index 9fe7f3cc5a963d35ffda73a3b2c0c1955719795d..4f272ecc1b1031fb20c5b8a40f7423d90efff89a 100644 (file)
@@ -5,6 +5,7 @@
 6 February 2020: Wouter
        - Fix num_reply_addr counting in mesh and tcp drop due to size
          after serve_stale commit.
+       - Fix to create and destroy rpz_lock in auth_zones structure.
 
 5 February 2020: George
        - Added serve-stale functionality as described in
index edff3e6dda0523c6bd8c9e60b86305aa61e25c1b..34170abaf4a228549dbf8bfa87d67f7e4145d2d0 100644 (file)
@@ -299,6 +299,8 @@ struct auth_zones* auth_zones_create(void)
        lock_protect(&az->lock, &az->ztree, sizeof(az->ztree));
        lock_protect(&az->lock, &az->xtree, sizeof(az->xtree));
        /* also lock protects the rbnode's in struct auth_zone, auth_xfer */
+       lock_rw_init(&az->rpz_lock);
+       lock_protect(&az->rpz_lock, &az->rpz_first, sizeof(az->rpz_first));
        return az;
 }
 
@@ -2104,6 +2106,7 @@ void auth_zones_delete(struct auth_zones* az)
 {
        if(!az) return;
        lock_rw_destroy(&az->lock);
+       lock_rw_destroy(&az->rpz_lock);
        traverse_postorder(&az->ztree, auth_zone_del, NULL);
        traverse_postorder(&az->xtree, auth_xfer_del, NULL);
        free(az);