The reference counting in lib/dns/zone.c is weird
There's:
-
.erefs
reference counter that starts with1
-
.irefs
reference counter that starts with0
-
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SHUTDOWN)
inexit_check()
-
INSIST(isc_refcount_increment(&source->irefs) + isc_refcount_current(&source->erefs) > 0);
inzone_iattach()
-
INSIST(isc_refcount_decrement(&zone->irefs) - 1 + isc_refcount_current(&zone->erefs) > 0);
inzone_idetach()
-
zone_idetach()
anddns_zone_idetach()
as independent functions whiledns_zone_idetach()
should probably callzone_idetach()
- same as the relation betweenzone_iattach()
anddns_zone_iattach()
It seems to me that we might just need one reference counter as .irefs
and .erefs
are always checked in tandem.