Commit a067337d authored by Marek Vavrusa's avatar Marek Vavrusa

process_query: fixed ANY/UDP disabling

parent c5e63095
......@@ -166,9 +166,10 @@ static int put_answer(knot_pkt_t *pkt, uint16_t type, struct query_data *qdata)
case KNOT_RRTYPE_ANY: /* Append all RRSets. */
/* If ANY not allowed, set TC bit. */
if ((qdata->param->proc_flags & NS_QUERY_LIMIT_ANY) &&
knot_zone_contents_any_disabled(qdata->zone->contents)) {
(qdata->zone->conf->disable_any)) {
dbg_ns("%s: ANY/UDP disabled for this zone TC=1\n", __func__);
knot_wire_set_tc(pkt->wire);
return KNOT_EOK;
return KNOT_ESPACE;
}
for (unsigned i = 0; i < knot_node_rrset_count(qdata->node); ++i) {
ret = put_rr(pkt, rrsets[i], compr_hint, 0, qdata);
......@@ -272,7 +273,7 @@ static int put_delegation(knot_pkt_t *pkt, struct query_data *qdata)
static int put_additional(knot_pkt_t *pkt, const knot_rrset_t *rr, knot_rrinfo_t *info)
{
/* Valid types for ADDITIONALS insertion. */
/* \note Not resolving CNAMEs as it doesn't pay off much. */
/* \note Not resolving CNAMEs as MX/NS name must not be an alias. (RFC2181/10.3) */
static const uint16_t ar_type_list[] = {KNOT_RRTYPE_A, KNOT_RRTYPE_AAAA};
static const int ar_type_count = 2;
......
......@@ -51,8 +51,6 @@ const uint8_t KNOT_ZONE_FLAGS_GEN_OLD = 0; /* xxxxxx00 */
const uint8_t KNOT_ZONE_FLAGS_GEN_NEW = 1 << 0; /* xxxxxx01 */
const uint8_t KNOT_ZONE_FLAGS_GEN_FIN = 1 << 1; /* xxxxxx10 */
const uint8_t KNOT_ZONE_FLAGS_GEN_MASK = 3; /* 00000011 */
const uint8_t KNOT_ZONE_FLAGS_ANY_MASK = 4; /* 00000100 */
const uint8_t KNOT_ZONE_FLAGS_ANY = 4; /* 00000100 */
/*----------------------------------------------------------------------------*/
......@@ -521,36 +519,6 @@ void knot_zone_contents_set_gen_new_finished(knot_zone_contents_t *contents)
/*----------------------------------------------------------------------------*/
int knot_zone_contents_any_disabled(const knot_zone_contents_t *contents)
{
return ((contents->flags & KNOT_ZONE_FLAGS_ANY_MASK)
== KNOT_ZONE_FLAGS_ANY);
}
/*----------------------------------------------------------------------------*/
void knot_zone_contents_disable_any(knot_zone_contents_t *contents)
{
if (contents == NULL) {
return;
}
contents->flags |= KNOT_ZONE_FLAGS_ANY;
}
/*----------------------------------------------------------------------------*/
void knot_zone_contents_enable_any(knot_zone_contents_t *contents)
{
if (contents == NULL) {
return;
}
contents->flags &= ~KNOT_ZONE_FLAGS_ANY_MASK;
}
/*----------------------------------------------------------------------------*/
uint16_t knot_zone_contents_class(const knot_zone_contents_t *contents)
{
if (contents == NULL || contents->apex == NULL
......
......@@ -98,10 +98,6 @@ void knot_zone_contents_set_gen_old(knot_zone_contents_t *contents);
void knot_zone_contents_set_gen_new(knot_zone_contents_t *contents);
void knot_zone_contents_set_gen_new_finished(knot_zone_contents_t *contents);
int knot_zone_contents_any_disabled(const knot_zone_contents_t *contents);
void knot_zone_contents_disable_any(knot_zone_contents_t *contents);
void knot_zone_contents_enable_any(knot_zone_contents_t *contents);
uint16_t knot_zone_contents_class(const knot_zone_contents_t *contents);
/*!
......
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