+ 733. [bug] Reference counts of dns_acl_t objects need to be
+ locked but were not. [RT #801]
+
708. [bug] When building with --with-openssl, the openssl headers
included should not be used. [RT #702]
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.c,v 1.17.4.1 2001/01/09 22:43:21 bwelling Exp $ */
+/* $Id: acl.c,v 1.17.4.2 2001/02/09 01:01:54 bwelling Exp $ */
#include <config.h>
return (ISC_R_NOMEMORY);
acl->mctx = mctx;
acl->name = NULL;
- acl->refcount = 1;
+ isc_refcount_init(&acl->refcount, 1);
acl->elements = NULL;
acl->alloc = 0;
acl->length = 0;
void
dns_acl_attach(dns_acl_t *source, dns_acl_t **target) {
REQUIRE(DNS_ACL_VALID(source));
- INSIST(source->refcount > 0);
- source->refcount++;
+ isc_refcount_increment(&source->refcount, NULL);
*target = source;
}
dacl->alloc * sizeof(dns_aclelement_t));
if (dacl->name != NULL)
isc_mem_free(dacl->mctx, dacl->name);
+ isc_refcount_destroy(&dacl->refcount);
dacl->magic = 0;
isc_mem_put(dacl->mctx, dacl, sizeof(*dacl));
}
void
dns_acl_detach(dns_acl_t **aclp) {
dns_acl_t *acl = *aclp;
+ unsigned int refs;
REQUIRE(DNS_ACL_VALID(acl));
- INSIST(acl->refcount > 0);
- acl->refcount--;
- if (acl->refcount == 0)
+ isc_refcount_decrement(&acl->refcount, &refs);
+ if (refs == 0)
destroy(acl);
*aclp = NULL;
}
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.h,v 1.16.4.1 2001/01/09 22:45:01 bwelling Exp $ */
+/* $Id: acl.h,v 1.16.4.2 2001/02/09 01:01:55 bwelling Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/netaddr.h>
+#include <isc/refcount.h>
#include <dns/name.h>
#include <dns/types.h>
struct dns_acl {
isc_uint32_t magic;
isc_mem_t *mctx;
- unsigned int refcount;
+ isc_refcount_t refcount;
dns_aclelement_t *elements;
unsigned int alloc; /* Elements allocated */
unsigned int length; /* Elements initialized */