buf[0] = '\0';
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
strlcat(buf, "negative response", sizeof(buf));
strlcat(buf, yaml ? "_" : ", ", sizeof(buf));
}
DNS_RDATASET_FOREACH (rdataset) {
dns_rdata_t rdata = DNS_RDATA_INIT;
- if ((rdataset->attributes &
- DNS_RDATASETATTR_NEGATIVE) != 0)
- {
+ if (rdataset->attributes.negative) {
continue;
}
}
} else {
dns_indent_t indent = { " ", 2 };
- if (!yaml && (rdataset->attributes &
- DNS_RDATASETATTR_NEGATIVE) != 0)
- {
+ if (!yaml && rdataset->attributes.negative) {
isc_buffer_putstr(&target, "; ");
}
result = dns_master_rdatasettotext(
dns_rdatatype_t rdtype;
const cfg_obj_t *obj;
dns_fixedname_t fixed;
- unsigned int mode = 0;
+ dns_orderopt_t mode = dns_order_none;
const char *str;
isc_buffer_t b;
isc_result_t result;
INSIST(cfg_obj_isstring(obj));
str = cfg_obj_asstring(obj);
if (!strcasecmp(str, "random")) {
- mode = DNS_RDATASETATTR_RANDOMIZE;
+ mode = dns_order_randomize;
} else if (!strcasecmp(str, "cyclic")) {
- mode = DNS_RDATASETATTR_CYCLIC;
+ mode = dns_order_cyclic;
} else if (!strcasecmp(str, "none")) {
- mode = DNS_RDATASETATTR_NONE;
+ mode = dns_order_none;
} else {
UNREACHABLE();
}
static void
mark_as_rendered(dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) {
if (rdataset != NULL && dns_rdataset_isassociated(rdataset)) {
- rdataset->attributes |= DNS_RDATASETATTR_RENDERED;
+ rdataset->attributes.rendered = true;
}
if (sigrdataset != NULL && dns_rdataset_isassociated(sigrdataset)) {
- sigrdataset->attributes |= DNS_RDATASETATTR_RENDERED;
+ sigrdataset->attributes.rendered = true;
}
}
static void
mark_as_rendered(dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) {
if (rdataset != NULL && dns_rdataset_isassociated(rdataset)) {
- rdataset->attributes |= DNS_RDATASETATTR_RENDERED;
+ rdataset->attributes.rendered = true;
}
if (sigrdataset != NULL && dns_rdataset_isassociated(sigrdataset)) {
- sigrdataset->attributes |= DNS_RDATASETATTR_RENDERED;
+ sigrdataset->attributes.rendered = true;
}
}
* The 'covers' argument is the RR type whose nonexistence we are caching,
* or dns_rdatatype_any when caching a NXDOMAIN response.
*
- * 'optout' indicates a DNS_RDATASETATTR_OPTOUT should be set.
+ * 'optout' parameter indicates if 'optout' attribute should be set.
*
* Note:
*\li If 'addedrdataset' is not NULL, then it will be attached to the added
void
dns_order_add(dns_order_t *order, const dns_name_t *name,
dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
- unsigned int mode);
+ dns_orderopt_t mode);
/*%<
* Add a entry to the end of the order list.
*
* Requires:
* \li 'order' to be valid.
*\li 'name' to be valid.
- *\li 'mode' to be one of #DNS_RDATASETATTR_RANDOMIZE,
- * #DNS_RDATASETATTR_FIXEDORDER or zero (#DNS_RDATASETATTR_CYCLIC).
*/
-unsigned int
+dns_orderopt_t
dns_order_find(dns_order_t *order, const dns_name_t *name,
dns_rdatatype_t rdtype, dns_rdataclass_t rdclass);
/*%<
dns_trust_t trust;
dns_rdatatype_t covers;
- /*
- * attributes
- */
- unsigned int attributes;
+ struct {
+ bool question : 1;
+ bool rendered : 1; /*%< message.c: was rendered */
+ bool answered : 1; /*%< server. */
+ bool cache : 1; /*%< resolver. */
+ bool answer : 1; /*%< resolver. */
+ bool answersig : 1; /*%< resolver. */
+ bool external : 1; /*%< resolver. */
+ bool ncache : 1; /*%< resolver. */
+ bool chaining : 1; /*%< resolver. */
+ bool ttladjusted : 1; /*%< message.c: data had differing TTL
+ values, and the rdataset->ttl holds the smallest */
+ bool chase : 1; /*%< Used by resolver. */
+ bool nxdomain : 1;
+ bool noqname : 1;
+ bool checknames : 1; /*%< Used by resolver. */
+ bool required : 1;
+ bool resign : 1;
+ bool closest : 1;
+ bool optout : 1; /*%< OPTOUT proof */
+ bool negative : 1;
+ bool prefetch : 1;
+ bool stale : 1;
+ bool ancient : 1;
+ bool stale_window : 1;
+ bool stale_added : 1; /*%< Added during a
+ stale-answer-client-timeout lookup. In other words, the
+ RRset was added during a lookup of stale data and does
+ not necessarily mean that the rdataset itself is stale.
+ */
+ bool keepcase : 1;
+ bool staticstub : 1;
+ dns_orderopt_t order : 2;
+ } attributes;
/*%
* the counter provides the starting point in the "cyclic" order.
/*
* This RRSIG RRset should be re-generated around this time.
- * Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
+ * Only valid if 'resign' attribute is set.
*/
union {
isc_stdtime_t resign;
DNS_RDATASET_FOREACH_RES(rds, DNS__RDATASET_CONCAT(x, __LINE__))
/* clang-format on */
-/*!
- * \def DNS_RDATASETATTR_RENDERED
- * Used by message.c to indicate that the rdataset was rendered.
- *
- * \def DNS_RDATASETATTR_TTLADJUSTED
- * Used by message.c to indicate that the rdataset's rdata had differing
- * TTL values, and the rdataset->ttl holds the smallest.
- *
- * \def DNS_RDATASETATTR_LOADORDER
- * Output the RRset in load order.
- *
- * \def DNS_RDATASETATTR_STALE_ADDED
- * Set on rdatasets that were added during a stale-answer-client-timeout
- * lookup. In other words, the RRset was added during a lookup of stale
- * data and does not necessarily mean that the rdataset itself is stale.
- */
-
-#define DNS_RDATASETATTR_NONE 0x00000000 /*%< No ordering. */
-#define DNS_RDATASETATTR_QUESTION 0x00000001
-#define DNS_RDATASETATTR_RENDERED 0x00000002 /*%< Used by message.c */
-#define DNS_RDATASETATTR_ANSWERED 0x00000004 /*%< Used by server. */
-#define DNS_RDATASETATTR_CACHE 0x00000008 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_ANSWER 0x00000010 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_ANSWERSIG 0x00000020 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_EXTERNAL 0x00000040 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_NCACHE 0x00000080 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_CHAINING 0x00000100 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_TTLADJUSTED 0x00000200 /*%< Used by message.c */
-#define DNS_RDATASETATTR_FIXEDORDER 0x00000400 /*%< Fixed ordering. */
-#define DNS_RDATASETATTR_RANDOMIZE 0x00000800 /*%< Random ordering. */
-#define DNS_RDATASETATTR_CHASE 0x00001000 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_NXDOMAIN 0x00002000
-#define DNS_RDATASETATTR_NOQNAME 0x00004000
-#define DNS_RDATASETATTR_CHECKNAMES 0x00008000 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_REQUIRED 0x00010000
-#define DNS_RDATASETATTR_REQUIREDGLUE DNS_RDATASETATTR_REQUIRED
-#define DNS_RDATASETATTR_UNUSED1 0x00020000
-#define DNS_RDATASETATTR_RESIGN 0x00040000
-#define DNS_RDATASETATTR_CLOSEST 0x00080000
-#define DNS_RDATASETATTR_OPTOUT 0x00100000 /*%< OPTOUT proof */
-#define DNS_RDATASETATTR_NEGATIVE 0x00200000
-#define DNS_RDATASETATTR_PREFETCH 0x00400000
-#define DNS_RDATASETATTR_CYCLIC 0x00800000 /*%< Cyclic ordering. */
-#define DNS_RDATASETATTR_STALE 0x01000000
-#define DNS_RDATASETATTR_ANCIENT 0x02000000
-#define DNS_RDATASETATTR_STALE_WINDOW 0x04000000
-#define DNS_RDATASETATTR_STALE_ADDED 0x08000000
-#define DNS_RDATASETATTR_KEEPCASE 0x10000000
-#define DNS_RDATASETATTR_STATICSTUB 0x20000000
-
/*%
* _OMITDNSSEC:
* Omit DNSSEC records when rendering ncache records.
* Return the noqname proof for this record.
*
* Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_NOQNAME to be set.
+ *\li 'rdataset' to be valid and 'noqname' attribute to be set.
*\li 'name' to be valid.
*\li 'neg' and 'negsig' to be valid and not associated.
*/
dns_rdataset_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name);
/*%<
* Associate a noqname proof with this record.
- * Sets #DNS_RDATASETATTR_NOQNAME if successful.
+ * Sets 'noqname' attribute if successful.
* Adjusts the 'rdataset->ttl' to minimum of the 'rdataset->ttl' and
* the 'nsec'/'nsec3' and 'rrsig(nsec)'/'rrsig(nsec3)' ttl.
*
* Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_NOQNAME to be set.
+ *\li 'rdataset' to be valid and 'noqname' attribute to be set.
*\li 'name' to be valid and have NSEC or NSEC3 and associated RRSIG
* rdatasets.
*/
* Return the closest encloser for this record.
*
* Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_CLOSEST to be set.
+ *\li 'rdataset' to be valid and 'closest' attribute to be set.
*\li 'name' to be valid.
*\li 'nsec' and 'nsecsig' to be valid and not associated.
*/
dns_rdataset_addclosest(dns_rdataset_t *rdataset, dns_name_t *name);
/*%<
* Associate a closest encloset proof with this record.
- * Sets #DNS_RDATASETATTR_CLOSEST if successful.
+ * Sets 'closest' attribute if successful.
* Adjusts the 'rdataset->ttl' to minimum of the 'rdataset->ttl' and
* the 'nsec' and 'rrsig(nsec)' ttl.
*
* Requires:
- *\li 'rdataset' to be valid and #DNS_RDATASETATTR_CLOSEST to be set.
+ *\li 'rdataset' to be valid and 'closest' attribute to be set.
*\li 'name' to be valid and have NSEC3 and RRSIG(NSEC3) rdatasets.
*/
dns_masterformat_raw = 2,
} dns_masterformat_t;
+typedef enum {
+ dns_order_none,
+ dns_order_cyclic,
+ dns_order_randomize
+} dns_orderopt_t;
+
typedef enum {
dns_expire_lru = 0,
dns_expire_ttl = 1,
if (dataset.type == dns_rdatatype_rrsig &&
(lctx->options & DNS_MASTER_RESIGN) != 0)
{
- dataset.attributes |= DNS_RDATASETATTR_RESIGN;
+ dataset.attributes.resign = true;
dataset.resign = resign_fromlist(this, lctx);
}
result = callbacks->add(callbacks->add_private, owner,
#define DNS_TOTEXT_LINEBREAK_MAXLEN 100
/*% Does the rdataset 'r' contain a stale answer? */
-#define STALE(r) (((r)->attributes & DNS_RDATASETATTR_STALE) != 0)
+#define STALE(r) (((r)->attributes.stale))
/*% Does the rdataset 'r' contain an expired answer? */
-#define ANCIENT(r) (((r)->attributes & DNS_RDATASETATTR_ANCIENT) != 0)
+#define ANCIENT(r) (((r)->attributes.ancient))
/*%
* Context structure for a masterfile dump in progress.
FILE *f);
};
-#define NXDOMAIN(x) (((x)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)
+#define NXDOMAIN(x) (((x)->attributes.nxdomain))
static const dns_indent_t default_indent = { "\t", 1 };
static const dns_indent_t default_yamlindent = { " ", 1 };
* Type.
*/
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
type = rdataset->covers;
} else {
type = rdataset->type;
INDENT_TO(type_column);
type_start = target->used;
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
RETERR(str_totext("\\-", target));
}
switch (type) {
* Rdata.
*/
INDENT_TO(rdata_column);
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
if (NXDOMAIN(rdataset)) {
RETERR(str_totext(";-$NXDOMAIN", target));
} else {
}
fprintf(f, "; %s\n", dns_trust_totext(rds->trust));
}
- if (((rds->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) &&
+ if ((rds->attributes.negative) &&
(ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0)
{
/* Omit negative cache entries */
}
}
if (((ctx->style.flags & DNS_STYLEFLAG_RESIGN) != 0) &&
- ((rds->attributes & DNS_RDATASETATTR_RESIGN) != 0))
+ (rds->attributes.resign))
{
isc_buffer_t b;
char buf[sizeof("YYYYMMDDHHMMSS")];
dns_rdataset_getownercase(&rdataset, name);
- if (((rdataset.attributes & DNS_RDATASETATTR_NEGATIVE) != 0) &&
+ if (rdataset.attributes.negative &&
(ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0)
{
/* Omit negative cache entries */
#define VALID_PSEUDOSECTION(s) \
(((s) >= DNS_PSEUDOSECTION_ANY) && ((s) < DNS_PSEUDOSECTION_MAX))
-#define OPTOUT(x) (((x)->attributes & DNS_RDATASETATTR_OPTOUT) != 0)
+#define OPTOUT(x) (((x)->attributes.optout))
/*%
* This is the size of each individual scratchpad buffer, and the numbers
dns_message_gettemprdataset(msg, &rdataset);
dns_rdatalist_tordataset(rdatalist, rdataset);
- rdataset->attributes |= DNS_RDATASETATTR_QUESTION;
+ rdataset->attributes.question = true;
ISC_LIST_APPEND(name->list, rdataset, link);
* minimize them.
*/
if (ttl != rdataset->ttl) {
- rdataset->attributes |= DNS_RDATASETATTR_TTLADJUSTED;
+ rdataset->attributes.ttladjusted = true;
if (ttl < rdataset->ttl) {
rdataset->ttl = ttl;
}
name = ISC_LIST_HEAD(*section);
if (name != NULL) {
rdataset = ISC_LIST_HEAD(name->list);
- if (rdataset != NULL &&
- (rdataset->attributes & DNS_RDATASETATTR_REQUIREDGLUE) !=
- 0 &&
- (rdataset->attributes & DNS_RDATASETATTR_RENDERED) == 0)
+ if (rdataset != NULL && rdataset->attributes.required &&
+ !rdataset->attributes.rendered)
{
st = *(msg->buffer);
count = 0;
update_min_section_ttl(msg, sectionid, rdataset);
- rdataset->attributes |= DNS_RDATASETATTR_RENDERED;
+ rdataset->attributes.rendered = true;
}
}
ISC_LIST_FOREACH (*section, n, link) {
ISC_LIST_FOREACH (n->list, rds, link) {
- if ((rds->attributes &
- DNS_RDATASETATTR_RENDERED) != 0)
- {
+ if (rds->attributes.rendered) {
continue;
}
update_min_section_ttl(msg, sectionid, rds);
- rds->attributes |= DNS_RDATASETATTR_RENDERED;
+ rds->attributes.rendered = true;
}
}
} while (--pass != 0);
msg->counts[i] = 0;
MSG_SECTION_FOREACH (msg, i, name) {
ISC_LIST_FOREACH (name->list, rds, link) {
- rds->attributes &= ~DNS_RDATASETATTR_RENDERED;
+ rds->attributes.rendered = false;
}
}
}
MSG_SECTION_FOREACH (msg, DNS_SECTION_AUTHORITY, name) {
ISC_LIST_FOREACH (name->list, rds, link) {
- if ((rds->attributes & DNS_RDATASETATTR_RENDERED) == 0)
- {
+ if (!rds->attributes.rendered) {
continue;
}
if (name->attributes.ncache) {
ISC_LIST_FOREACH (name->list, rdataset, link) {
- if ((rdataset->attributes &
- DNS_RDATASETATTR_NCACHE) == 0)
- {
+ if (!rdataset->attributes.ncache) {
continue;
}
type = rdataset->type;
trust = dns_trust_answer;
}
ncrdataset.trust = trust;
- ncrdataset.attributes |= DNS_RDATASETATTR_NEGATIVE;
+ ncrdataset.attributes.negative = true;
if (message->rcode == dns_rcode_nxdomain) {
- ncrdataset.attributes |= DNS_RDATASETATTR_NXDOMAIN;
+ ncrdataset.attributes.nxdomain = true;
}
if (optout) {
- ncrdataset.attributes |= DNS_RDATASETATTR_OPTOUT;
+ ncrdataset.attributes.optout = true;
}
return dns_db_addrdataset(cache, node, NULL, now, &ncrdataset, 0,
REQUIRE(rdataset != NULL);
REQUIRE(rdataset->type == 0);
- REQUIRE((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0);
+ REQUIRE(rdataset->attributes.negative);
savedbuffer = *target;
count = 0;
REQUIRE(ncacherdataset != NULL);
REQUIRE(DNS_RDATASET_VALID(ncacherdataset));
REQUIRE(ncacherdataset->type == 0);
- REQUIRE((ncacherdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0);
+ REQUIRE(ncacherdataset->attributes.negative);
REQUIRE(name != NULL);
REQUIRE(!dns_rdataset_isassociated(rdataset));
REQUIRE(type != dns_rdatatype_rrsig);
REQUIRE(ncacherdataset != NULL);
REQUIRE(ncacherdataset->type == 0);
- REQUIRE((ncacherdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0);
+ REQUIRE(ncacherdataset->attributes.negative);
REQUIRE(name != NULL);
REQUIRE(!dns_rdataset_isassociated(rdataset));
REQUIRE(ncacherdataset != NULL);
REQUIRE(ncacherdataset->type == 0);
- REQUIRE((ncacherdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0);
+ REQUIRE(ncacherdataset->attributes.negative);
REQUIRE(found != NULL);
REQUIRE(!dns_rdataset_isassociated(rdataset));
dns_fixedname_t name;
dns_rdataclass_t rdclass;
dns_rdatatype_t rdtype;
- unsigned int mode;
+ dns_orderopt_t mode;
ISC_LINK(dns_order_ent_t) link;
};
void
dns_order_add(dns_order_t *order, const dns_name_t *name,
dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
- unsigned int mode) {
+ dns_orderopt_t mode) {
dns_order_ent_t *ent = NULL;
REQUIRE(DNS_ORDER_VALID(order));
- REQUIRE(mode == DNS_RDATASETATTR_RANDOMIZE ||
- mode == DNS_RDATASETATTR_FIXEDORDER ||
- mode == DNS_RDATASETATTR_CYCLIC ||
- mode == DNS_RDATASETATTR_NONE);
ent = isc_mem_get(order->mctx, sizeof(*ent));
*ent = (dns_order_ent_t){
return dns_name_equal(name1, name2);
}
-unsigned int
+dns_orderopt_t
dns_order_find(dns_order_t *order, const dns_name_t *name,
dns_rdatatype_t rdtype, dns_rdataclass_t rdclass) {
REQUIRE(DNS_ORDER_VALID(order));
return ent->mode;
}
}
- return DNS_RDATASETATTR_NONE;
+ return dns_order_none;
}
void
rdataset->resign = 0;
if (NEGATIVE(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_NEGATIVE;
+ rdataset->attributes.negative = true;
}
if (NXDOMAIN(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_NXDOMAIN;
+ rdataset->attributes.nxdomain = true;
}
if (OPTOUT(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_OPTOUT;
+ rdataset->attributes.optout = true;
}
if (PREFETCH(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_PREFETCH;
+ rdataset->attributes.prefetch = true;
}
if (stale && !ancient) {
rdataset->ttl = 0;
}
if (STALE_WINDOW(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_STALE_WINDOW;
+ rdataset->attributes.stale_window = true;
}
- rdataset->attributes |= DNS_RDATASETATTR_STALE;
+ rdataset->attributes.stale = true;
rdataset->expire = header->expire;
} else if (!ACTIVE(header, now)) {
- rdataset->attributes |= DNS_RDATASETATTR_ANCIENT;
+ rdataset->attributes.ancient = true;
rdataset->ttl = 0;
}
*/
rdataset->slab.noqname = header->noqname;
if (header->noqname != NULL) {
- rdataset->attributes |= DNS_RDATASETATTR_NOQNAME;
+ rdataset->attributes.noqname = true;
}
rdataset->slab.closest = header->closest;
if (header->closest != NULL) {
- rdataset->attributes |= DNS_RDATASETATTR_CLOSEST;
+ rdataset->attributes.closest = true;
}
}
atomic_init(&newheader->count,
atomic_fetch_add_relaxed(&init_count, 1));
- if ((rdataset->attributes & DNS_RDATASETATTR_PREFETCH) != 0) {
+ if (rdataset->attributes.prefetch) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_PREFETCH);
}
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_NEGATIVE);
}
- if ((rdataset->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0) {
+ if (rdataset->attributes.nxdomain) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_NXDOMAIN);
}
- if ((rdataset->attributes & DNS_RDATASETATTR_OPTOUT) != 0) {
+ if (rdataset->attributes.optout) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_OPTOUT);
}
- if ((rdataset->attributes & DNS_RDATASETATTR_NOQNAME) != 0) {
+ if (rdataset->attributes.noqname) {
result = addnoqname(qpdb->common.mctx, newheader,
qpdb->maxrrperset, rdataset);
if (result != ISC_R_SUCCESS) {
return result;
}
}
- if ((rdataset->attributes & DNS_RDATASETATTR_CLOSEST) != 0) {
+ if (rdataset->attributes.closest) {
result = addclosest(qpdb->common.mctx, newheader,
qpdb->maxrrperset, rdataset);
if (result != ISC_R_SUCCESS) {
rdataset->trust = header->trust;
if (OPTOUT(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_OPTOUT;
+ rdataset->attributes.optout = true;
}
rdataset->count = atomic_fetch_add_relaxed(&header->count, 1);
*/
rdataset->slab.noqname = header->noqname;
if (header->noqname != NULL) {
- rdataset->attributes |= DNS_RDATASETATTR_NOQNAME;
+ rdataset->attributes.noqname = true;
}
rdataset->slab.closest = header->closest;
if (header->closest != NULL) {
- rdataset->attributes |= DNS_RDATASETATTR_CLOSEST;
+ rdataset->attributes.closest = true;
}
/*
* Copy out re-signing information.
*/
if (RESIGN(header)) {
- rdataset->attributes |= DNS_RDATASETATTR_RESIGN;
+ rdataset->attributes.resign = true;
rdataset->resign = (header->resign << 1) | header->resign_lsb;
} else {
rdataset->resign = 0;
dns_slabheader_setownercase(newheader, name);
- if ((rdataset->attributes & DNS_RDATASETATTR_RESIGN) != 0) {
+ if (rdataset->attributes.resign) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_RESIGN);
newheader->resign =
(isc_stdtime_t)(dns_time64_from32(rdataset->resign) >>
atomic_fetch_add_relaxed(&init_count, 1));
newheader->serial = version->serial;
- if ((rdataset->attributes & DNS_RDATASETATTR_RESIGN) != 0) {
+ if (rdataset->attributes.resign) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_RESIGN);
newheader->resign =
(isc_stdtime_t)(dns_time64_from32(rdataset->resign) >>
newheader->serial = version->serial;
atomic_init(&newheader->count,
atomic_fetch_add_relaxed(&init_count, 1));
- if ((rdataset->attributes & DNS_RDATASETATTR_RESIGN) != 0) {
+ if (rdataset->attributes.resign) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_RESIGN);
newheader->resign =
(isc_stdtime_t)(dns_time64_from32(rdataset->resign) >>
/*
* If the currently processed NS record is in-bailiwick, mark any glue
- * RRsets found for it with DNS_RDATASETATTR_REQUIRED. Note that for
+ * RRsets found for it with 'required' attribute. Note that for
* simplicity, glue RRsets for all in-bailiwick NS records are marked
* this way, even though dns_message_rendersection() only checks the
* attributes for the first rdataset associated with the first name
*/
if (glue != NULL && dns_name_issubdomain(name, &node->name)) {
if (dns_rdataset_isassociated(&glue->rdataset_a)) {
- glue->rdataset_a.attributes |=
- DNS_RDATASETATTR_REQUIRED;
+ glue->rdataset_a.attributes.required = true;
}
if (dns_rdataset_isassociated(&glue->rdataset_aaaa)) {
- glue->rdataset_aaaa.attributes |=
- DNS_RDATASETATTR_REQUIRED;
+ glue->rdataset_aaaa.attributes.required = true;
}
}
return result;
}
-#define IS_REQUIRED_GLUE(r) (((r)->attributes & DNS_RDATASETATTR_REQUIRED) != 0)
+#define IS_REQUIRED_GLUE(r) (((r)->attributes.required))
static void
addglue_to_message(dns_glue_t *ge, dns_message_t *msg) {
ttl = negsig->ttl;
}
rdataset->ttl = neg->ttl = negsig->ttl = ttl;
- rdataset->attributes |= DNS_RDATASETATTR_NOQNAME;
+ rdataset->attributes.noqname = true;
rdataset->rdlist.noqname = name;
return ISC_R_SUCCESS;
}
dns_name_t *noqname = NULL;
REQUIRE(rdataset != NULL);
- REQUIRE((rdataset->attributes & DNS_RDATASETATTR_NOQNAME) != 0);
+ REQUIRE(rdataset->attributes.noqname);
rdclass = rdataset->rdclass;
noqname = rdataset->rdlist.noqname;
ttl = negsig->ttl;
}
rdataset->ttl = neg->ttl = negsig->ttl = ttl;
- rdataset->attributes |= DNS_RDATASETATTR_CLOSEST;
+ rdataset->attributes.closest = true;
rdataset->rdlist.closest = name;
return ISC_R_SUCCESS;
}
dns_name_t *closest = NULL;
REQUIRE(rdataset != NULL);
- REQUIRE((rdataset->attributes & DNS_RDATASETATTR_CLOSEST) != 0);
+ REQUIRE(rdataset->attributes.closest);
rdclass = rdataset->rdclass;
closest = rdataset->rdlist.closest;
#include <dns/ncache.h>
#include <dns/rdata.h>
#include <dns/rdataset.h>
+#include <dns/types.h>
static const char *trustnames[] = {
"none", "pending-additional",
rdataset->methods = &question_methods;
rdataset->rdclass = rdclass;
rdataset->type = type;
- rdataset->attributes |= DNS_RDATASETATTR_QUESTION;
+ rdataset->attributes.question = true;
}
unsigned int
}
#define MAX_SHUFFLE 32
-#define WANT_FIXED(r) (((r)->attributes & DNS_RDATASETATTR_FIXEDORDER) != 0)
-#define WANT_RANDOM(r) (((r)->attributes & DNS_RDATASETATTR_RANDOMIZE) != 0)
-#define WANT_CYCLIC(r) (((r)->attributes & DNS_RDATASETATTR_CYCLIC) != 0)
+#define WANT_RANDOM(r) (((r)->attributes.order == dns_order_randomize))
+#define WANT_CYCLIC(r) (((r)->attributes.order == dns_order_cyclic))
struct towire_sort {
int key;
want_random = WANT_RANDOM(rdataset);
want_cyclic = WANT_CYCLIC(rdataset);
- if ((rdataset->attributes & DNS_RDATASETATTR_QUESTION) != 0) {
+ if (rdataset->attributes.question) {
question = true;
count = 1;
result = dns_rdataset_first(rdataset);
INSIST(result == ISC_R_NOMORE);
- } else if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ } else if (rdataset->attributes.negative) {
/*
* This is a negative caching rdataset.
*/
*/
REQUIRE(DNS_RDATASET_VALID(rdataset));
- REQUIRE((rdataset->attributes & DNS_RDATASETATTR_QUESTION) == 0);
+ REQUIRE(!rdataset->attributes.question);
if (limit != 0 && dns_rdataset_count(rdataset) > limit) {
return DNS_R_TOOMANYRECORDS;
REQUIRE(rdataset->methods != NULL);
if (rdataset->methods->setownercase != NULL &&
- (rdataset->attributes & DNS_RDATASETATTR_KEEPCASE) == 0)
+ !rdataset->attributes.keepcase)
{
(rdataset->methods->setownercase)(rdataset, name);
}
REQUIRE(rdataset->methods != NULL);
if (rdataset->methods->getownercase != NULL &&
- (rdataset->attributes & DNS_RDATASETATTR_KEEPCASE) == 0)
+ !rdataset->attributes.keepcase)
{
(rdataset->methods->getownercase)(rdataset, name);
}
.slab.raw = noqname->neg,
.link = nsec->link,
.count = nsec->count,
- .attributes = nsec->attributes | DNS_RDATASETATTR_KEEPCASE,
+ .attributes = nsec->attributes,
.magic = nsec->magic,
};
+ nsec->attributes.keepcase = true;
dns__db_attachnode(db, node,
&(dns_dbnode_t *){ NULL } DNS__DB_FLARG_PASS);
.slab.raw = noqname->negsig,
.link = nsecsig->link,
.count = nsecsig->count,
- .attributes = nsecsig->attributes | DNS_RDATASETATTR_KEEPCASE,
+ .attributes = nsecsig->attributes,
.magic = nsecsig->magic,
};
+ nsecsig->attributes.keepcase = true;
dns_name_clone(&noqname->name, name);
.slab.raw = closest->neg,
.link = nsec->link,
.count = nsec->count,
- .attributes = nsec->attributes | DNS_RDATASETATTR_KEEPCASE,
+ .attributes = nsec->attributes,
.magic = nsec->magic,
};
+ nsec->attributes.keepcase = true;
dns__db_attachnode(db, node,
&(dns_dbnode_t *){ NULL } DNS__DB_FLARG_PASS);
.slab.raw = closest->negsig,
.link = nsecsig->link,
.count = nsecsig->count,
- .attributes = nsecsig->attributes | DNS_RDATASETATTR_KEEPCASE,
+ .attributes = nsecsig->attributes,
.magic = nsecsig->magic,
};
+ nsecsig->attributes.keepcase = true;
dns_name_clone(&closest->name, name);
#define BADCOOKIE(a) (((a)->flags & FCTX_ADDRINFO_BADCOOKIE) != 0)
#define ISDUALSTACK(a) (((a)->flags & FCTX_ADDRINFO_DUALSTACK) != 0)
-#define NXDOMAIN(r) (((r)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)
-#define NEGATIVE(r) (((r)->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)
-#define STATICSTUB(r) (((r)->attributes & DNS_RDATASETATTR_STATICSTUB) != 0)
+#define NXDOMAIN(r) (((r)->attributes.nxdomain))
+#define NEGATIVE(r) (((r)->attributes.negative))
+#define STATICSTUB(r) (((r)->attributes.staticstub))
#ifdef ENABLE_AFL
bool dns_fuzzing_resolver = false;
}
}
-#define CACHE(r) (((r)->attributes & DNS_RDATASETATTR_CACHE) != 0)
-#define ANSWER(r) (((r)->attributes & DNS_RDATASETATTR_ANSWER) != 0)
-#define ANSWERSIG(r) (((r)->attributes & DNS_RDATASETATTR_ANSWERSIG) != 0)
-#define EXTERNAL(r) (((r)->attributes & DNS_RDATASETATTR_EXTERNAL) != 0)
-#define CHAINING(r) (((r)->attributes & DNS_RDATASETATTR_CHAINING) != 0)
-#define CHASE(r) (((r)->attributes & DNS_RDATASETATTR_CHASE) != 0)
-#define CHECKNAMES(r) (((r)->attributes & DNS_RDATASETATTR_CHECKNAMES) != 0)
+#define CACHE(r) (((r)->attributes.cache))
+#define ANSWER(r) (((r)->attributes.answer))
+#define ANSWERSIG(r) (((r)->attributes.answersig))
+#define EXTERNAL(r) (((r)->attributes.external))
+#define CHAINING(r) (((r)->attributes.chaining))
+#define CHASE(r) (((r)->attributes.chase))
+#define CHECKNAMES(r) (((r)->attributes.checknames))
/*
* Cancel validators associated with '*fctx' if it is ready to be
* Mark the rdataset as being prefetch eligible.
*/
if (rdataset->ttl >= fctx->res->view->prefetch_eligible) {
- rdataset->attributes |= DNS_RDATASETATTR_PREFETCH;
+ rdataset->attributes.prefetch = true;
}
/*
*/
if (rdataset->ttl >= fctx->res->view->prefetch_eligible)
{
- rdataset->attributes |=
- DNS_RDATASETATTR_PREFETCH;
+ rdataset->attributes.prefetch = true;
}
/*
*/
if (!CACHE(rdataset)) {
name->attributes.chase = true;
- rdataset->attributes |= DNS_RDATASETATTR_CHASE;
+ rdataset->attributes.chase = true;
}
- rdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ rdataset->attributes.cache = true;
if (external) {
- rdataset->attributes |= DNS_RDATASETATTR_EXTERNAL;
+ rdataset->attributes.external = true;
}
}
rdata.type, false) ||
!dns_rdata_checknames(&rdata, name, NULL))
{
- rdataset->attributes |=
- DNS_RDATASETATTR_CHECKNAMES;
+ rdataset->attributes.checknames = true;
}
}
}
rctx->aname->attributes.cache = true;
rctx->aname->attributes.answer = true;
- rdataset->attributes |= DNS_RDATASETATTR_ANSWER;
- rdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ rdataset->attributes.answer = true;
+ rdataset->attributes.cache = true;
rdataset->trust = rctx->trust;
}
rctx->aname->attributes.cache = true;
rctx->aname->attributes.answer = true;
- rctx->ardataset->attributes |= DNS_RDATASETATTR_ANSWER;
- rctx->ardataset->attributes |= DNS_RDATASETATTR_CACHE;
+ rctx->ardataset->attributes.answer = true;
+ rctx->ardataset->attributes.cache = true;
rctx->ardataset->trust = rctx->trust;
(void)dns_rdataset_additionaldata(rctx->ardataset, rctx->aname,
check_related, rctx,
continue;
}
- sigrdataset->attributes |= DNS_RDATASETATTR_ANSWERSIG;
- sigrdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ sigrdataset->attributes.answersig = true;
+ sigrdataset->attributes.cache = true;
sigrdataset->trust = rctx->trust;
break;
}
rctx->cname->attributes.cache = true;
rctx->cname->attributes.answer = true;
rctx->cname->attributes.chaining = true;
- rctx->crdataset->attributes |= DNS_RDATASETATTR_ANSWER;
- rctx->crdataset->attributes |= DNS_RDATASETATTR_CACHE;
- rctx->crdataset->attributes |= DNS_RDATASETATTR_CHAINING;
+ rctx->crdataset->attributes.answer = true;
+ rctx->crdataset->attributes.cache = true;
+ rctx->crdataset->attributes.chaining = true;
rctx->crdataset->trust = rctx->trust;
ISC_LIST_FOREACH (rctx->cname->list, sigrdataset, link) {
continue;
}
- sigrdataset->attributes |= DNS_RDATASETATTR_ANSWERSIG;
- sigrdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ sigrdataset->attributes.answersig = true;
+ sigrdataset->attributes.cache = true;
sigrdataset->trust = rctx->trust;
break;
}
rctx->dname->attributes.cache = true;
rctx->dname->attributes.answer = true;
rctx->dname->attributes.chaining = true;
- rctx->drdataset->attributes |= DNS_RDATASETATTR_ANSWER;
- rctx->drdataset->attributes |= DNS_RDATASETATTR_CACHE;
- rctx->drdataset->attributes |= DNS_RDATASETATTR_CHAINING;
+ rctx->drdataset->attributes.answer = true;
+ rctx->drdataset->attributes.cache = true;
+ rctx->drdataset->attributes.chaining = true;
rctx->drdataset->trust = rctx->trust;
ISC_LIST_FOREACH (rctx->dname->list, sigrdataset, link) {
continue;
}
- sigrdataset->attributes |= DNS_RDATASETATTR_ANSWERSIG;
- sigrdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ sigrdataset->attributes.answersig = true;
+ sigrdataset->attributes.cache = true;
sigrdataset->trust = rctx->trust;
break;
}
rdataset->covers == dns_rdatatype_ns))
{
name->attributes.cache = true;
- rdataset->attributes |=
- DNS_RDATASETATTR_CACHE;
+ rdataset->attributes.cache = true;
if (rctx->aa) {
rdataset->trust =
rctx->ns_rdataset = rdataset;
}
name->attributes.cache = true;
- rdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ rdataset->attributes.cache = true;
rdataset->trust = dns_trust_glue;
break;
case dns_rdatatype_soa:
rctx->soa_name = name;
}
name->attributes.ncache = true;
- rdataset->attributes |= DNS_RDATASETATTR_NCACHE;
+ rdataset->attributes.ncache = true;
if (rctx->aa) {
rdataset->trust =
dns_trust_authauthority;
case dns_rdatatype_nsec3:
if (rctx->negative) {
name->attributes.ncache = true;
- rdataset->attributes |=
- DNS_RDATASETATTR_NCACHE;
+ rdataset->attributes.ncache = true;
} else if (type == dns_rdatatype_nsec) {
name->attributes.cache = true;
- rdataset->attributes |=
- DNS_RDATASETATTR_CACHE;
+ rdataset->attributes.cache = true;
}
if (rctx->aa) {
}
name->attributes.cache = true;
- rdataset->attributes |= DNS_RDATASETATTR_CACHE;
+ rdataset->attributes.cache = true;
if ((fctx->options & DNS_FETCHOPT_NONTA) != 0) {
checknta = false;
name->attributes.chase = false;
ISC_LIST_FOREACH (name->list, rdataset, link) {
if (CHASE(rdataset)) {
- rdataset->attributes &= ~DNS_RDATASETATTR_CHASE;
+ rdataset->attributes.chase = false;
(void)dns_rdataset_additionaldata(
rdataset, name, check_related, rctx,
DNS_RDATASET_MAXADDITIONAL);
#define OFFLOADED(v) (((v)->attributes & VALATTR_OFFLOADED) != 0)
#define COMPLETE(v) (((v)->attributes & VALATTR_COMPLETE) != 0)
-#define NEGATIVE(r) (((r)->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)
-#define NXDOMAIN(r) (((r)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)
+#define NEGATIVE(r) (((r)->attributes.negative))
+#define NXDOMAIN(r) (((r)->attributes.nxdomain))
#define MAXVALIDATIONS(r) (((r)->attributes & VALATTR_MAXVALIDATIONS) != 0)
#define MAXVALIDATIONFAILS(r) \
* addresses we use the configured server addresses.
*/
if (dns_zone_gettype(zone) == dns_zone_staticstub) {
- rdataset->attributes |= DNS_RDATASETATTR_STATICSTUB;
+ rdataset->attributes.staticstub = true;
}
if (use_cache && view->cachedb != NULL && db != view->hints) {
#define QUERY_STALETIMEOUT(q) (((q)->dboptions & DNS_DBFIND_STALETIMEOUT) != 0)
/*% Does the rdataset 'r' have an attached 'No QNAME Proof'? */
-#define NOQNAME(r) (((r)->attributes & DNS_RDATASETATTR_NOQNAME) != 0)
+#define NOQNAME(r) (((r)->attributes.noqname))
/*% Does the rdataset 'r' contain a stale answer? */
-#define STALE(r) (((r)->attributes & DNS_RDATASETATTR_STALE) != 0)
+#define STALE(r) (((r)->attributes.stale))
/*% Does the rdataset 'r' is stale and within stale-refresh-time? */
-#define STALE_WINDOW(r) (((r)->attributes & DNS_RDATASETATTR_STALE_WINDOW) != 0)
+#define STALE_WINDOW(r) (((r)->attributes.stale_window))
#ifdef WANT_QUERYTRACE
static void
static void
query_addauth(query_ctx_t *qctx);
-static void
-query_clear_stale(ns_client_t *client);
-
/*
* Increment query statistics counters.
*/
UNUSED(client);
if (order != NULL) {
- rdataset->attributes |= dns_order_find(
+ rdataset->attributes.order = dns_order_find(
order, name, rdataset->type, rdataset->rdclass);
}
}
if (dbuf != NULL) {
ns_client_releasename(client, namep);
}
- if ((rdataset->attributes & DNS_RDATASETATTR_REQUIRED) != 0) {
- mrdataset->attributes |= DNS_RDATASETATTR_REQUIRED;
+ if (rdataset->attributes.required) {
+ mrdataset->attributes.required = true;
}
- if ((rdataset->attributes & DNS_RDATASETATTR_STALE_ADDED) != 0)
- {
- mrdataset->attributes |= DNS_RDATASETATTR_STALE_ADDED;
+ if (rdataset->attributes.stale_added) {
+ mrdataset->attributes.stale_added = true;
}
return;
} else if (result == DNS_R_NXDOMAIN) {
if (FETCH_RECTYPE_PREFETCH(client) != NULL ||
client->inner.view->prefetch_trigger == 0U ||
rdataset->ttl > client->inner.view->prefetch_trigger ||
- (rdataset->attributes & DNS_RDATASETATTR_PREFETCH) == 0)
+ !rdataset->attributes.prefetch)
{
return;
}
/*
* Look for a signature in a negative cache rdataset.
*/
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) == 0) {
+ if (!rdataset->attributes.negative) {
return true;
}
found = dns_fixedname_initname(&fixed);
{
return ISC_R_NOTFOUND;
}
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
DNS_RDATASET_FOREACH (rdataset) {
dns_ncache_current(rdataset, found, &trdataset);
type = trdataset.type;
{
return ISC_R_NOTFOUND;
}
- if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
+ if (rdataset->attributes.negative) {
DNS_RDATASET_FOREACH (rdataset) {
dns_ncache_current(rdataset, found, &trdataset);
type = trdataset.type;
* clean it up if needed when we resume from recursion.
*/
qctx->client->query.attributes |= NS_QUERYATTR_STALEOK;
- qctx->rdataset->attributes |= DNS_RDATASETATTR_STALE_ADDED;
+ qctx->rdataset->attributes.stale_added = true;
}
result = query_gotanswer(qctx, result);
}
/*
- * Clear all rdatasets from the message that are in the given section and
- * that have the 'attr' attribute set.
+ * Clear all rdatasets from the message, or only those with stale_added
+ * attribute set.
*/
static void
-message_clearrdataset(dns_message_t *msg, unsigned int attr) {
+message_clearrdataset(dns_message_t *msg, bool stale_only) {
unsigned int i;
/*
for (i = DNS_SECTION_ANSWER; i < DNS_SECTION_MAX; i++) {
ISC_LIST_FOREACH (msg->sections[i], name, link) {
ISC_LIST_FOREACH (name->list, rds, link) {
- if ((rds->attributes & attr) != attr) {
+ if (stale_only && !rds->attributes.stale_added)
+ {
continue;
}
ISC_LIST_UNLINK(name->list, rds, link);
}
}
-/*
- * Clear any rdatasets from the client's message that were added on a lookup
- * due to a client timeout.
- */
-static void
-query_clear_stale(ns_client_t *client) {
- message_clearrdataset(client->message, DNS_RDATASETATTR_STALE_ADDED);
-}
-
/*
* Event handler to resume processing a query after recursion, or when a
* client timeout is triggered. If the query has timed out or been cancelled
} else if (result == DNS_R_NCACHENXDOMAIN &&
qctx->rdataset != NULL &&
dns_rdataset_isassociated(qctx->rdataset) &&
- (qctx->rdataset->attributes &
- DNS_RDATASETATTR_NEGATIVE) != 0)
+ qctx->rdataset->attributes.negative)
{
/*
* Try to use owner name in the negative cache SOA.
query_addrrset(qctx, &fname, &neg, &negsig, dbuf,
DNS_SECTION_AUTHORITY);
- if ((qctx->noqname->attributes & DNS_RDATASETATTR_CLOSEST) == 0) {
+ if (!qctx->noqname->attributes.closest) {
goto cleanup;
}
!QUERY_STALETIMEOUT(&qctx->client->query) && !qctx->refresh_rrset)
{
CCTRACE(ISC_LOG_DEBUG(3), "query_clear_stale");
- query_clear_stale(qctx->client);
+ /*
+ * Clear any rdatasets from the client's message that were added
+ * on a lookup due to a client timeout.
+ */
+ message_clearrdataset(qctx->client->message, true);
/*
* We can clear the attribute to prevent redundant clearing
* in subsequent lookups.
}
if (section == DNS_SECTION_ADDITIONAL) {
- rdataset->attributes |= DNS_RDATASETATTR_REQUIRED;
+ rdataset->attributes.required = true;
}
query_addrrset(qctx, &name, &rdataset, sigrdatasetp, NULL,
section);
link);
ISC_LIST_PREPEND(name->list, rdataset,
link);
- rdataset->attributes |=
- DNS_RDATASETATTR_REQUIRED;
+ rdataset->attributes.required = true;
break;
}
}
* RRsets, clear the RRsets from the message before doing the
* refresh.
*/
- message_clearrdataset(qctx->client->message, 0);
+ message_clearrdataset(qctx->client->message, false);
query_stale_refresh(qctx->client);
}
do {
count++;
assert_in_range(count, 1, 21); /* loop sanity */
- assert_int_equal(rdataset.attributes &
- DNS_RDATASETATTR_STALE,
- 0);
+ assert_int_equal(rdataset.attributes.stale, false);
assert_true(rdataset.ttl > 0);
dns_db_detachnode(db, &node);
dns_rdataset_disassociate(&rdataset);
count++;
assert_in_range(count, 0, 49); /* loop sanity */
assert_int_equal(result, ISC_R_SUCCESS);
- assert_int_equal(rdataset.attributes &
- DNS_RDATASETATTR_STALE,
- DNS_RDATASETATTR_STALE);
+ assert_int_equal(rdataset.attributes.stale,
+ true);
dns_db_detachnode(db, &node);
dns_rdataset_disassociate(&rdataset);