Commit 7fec60c9 authored by Daniel Salzman's avatar Daniel Salzman

zone: don't check if signed zone for each query

parent b17c14b2
......@@ -116,7 +116,7 @@ static bool dname_cname_cannot_synth(const knot_rrset_t *rrset, const knot_dname
static bool have_dnssec(knotd_qdata_t *qdata)
{
return knot_pkt_has_dnssec(qdata->query) &&
zone_contents_is_signed(qdata->extra->zone->contents);
qdata->extra->zone->contents->dnssec;
}
/*! \brief This is a wildcard-covered or any other terminal node for QNAME.
......
......@@ -995,6 +995,7 @@ static int contents_adjust(zone_contents_t *contents, bool normal)
};
contents->size = 0;
contents->dnssec = node_rrtype_is_signed(contents->apex, KNOT_RRTYPE_SOA);
ret = adjust_nodes(contents->nodes, &arg,
normal ? adjust_normal_node : adjust_pointers);
......@@ -1146,11 +1147,6 @@ void zone_contents_set_soa_serial(zone_contents_t *zone, uint32_t new_serial)
}
}
bool zone_contents_is_signed(const zone_contents_t *zone)
{
return node_rrtype_is_signed(zone->apex, KNOT_RRTYPE_SOA);
}
bool zone_contents_is_empty(const zone_contents_t *zone)
{
if (zone == NULL) {
......
......@@ -42,6 +42,7 @@ typedef struct zone_contents {
dnssec_nsec3_params_t nsec3_params;
size_t size;
bool dnssec;
} zone_contents_t;
/*!
......@@ -93,9 +94,6 @@ zone_node_t *zone_contents_get_node_for_rr(zone_contents_t *zone, const knot_rrs
/*!
* \brief Tries to find a node with the specified name in the zone.
*
* \note This function is identical to zone_contents_get_node(), only it returns
* constant reference.
*
* \param contents Zone where the name should be searched for.
* \param name Name to find.
*
......@@ -262,11 +260,6 @@ uint32_t zone_contents_serial(const zone_contents_t *zone);
*/
void zone_contents_set_soa_serial(zone_contents_t *zone, uint32_t new_serial);
/*!
* \brief Return true if zone is signed.
*/
bool zone_contents_is_signed(const zone_contents_t *zone);
/*!
* \brief Return true if zone is empty.
*/
......
......@@ -1165,7 +1165,7 @@ int sem_checks_process(zone_contents_t *zone, bool optional, sem_handler_t *hand
if (optional) {
data.level |= OPTIONAL;
if (zone_contents_is_signed(zone)) {
if (zone->dnssec) {
knot_rdataset_t *nsec3param = node_rdataset(zone->apex,
KNOT_RRTYPE_NSEC3PARAM);
if (nsec3param != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment