- Fix to create and destroy rpz_lock in auth_zones structure.

This commit is contained in:
W.C.A. Wijngaards 2020-02-06 11:51:17 +01:00
parent 0758d29324
commit d000523b00
2 changed files with 4 additions and 0 deletions

View 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

View 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);