Skip to content
Snippets Groups Projects
Commit c07e8b6b authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge !109: layer/iterate: glue processing has been fixed

There was (always) a bug in the "normal mode", which complicated
difficult cases like zive.cz in default setting.
parents 90cd7c0c 4d77ec90
Branches
Tags
1 merge request!109layer/iterate: glue processing has been fixed
......@@ -211,7 +211,8 @@ static int has_glue(knot_pkt_t *pkt, const knot_dname_t *ns)
return 0;
}
static int update_cut(knot_pkt_t *pkt, const knot_rrset_t *rr, struct kr_request *req)
static int update_cut(knot_pkt_t *pkt, const knot_rrset_t *rr,
struct kr_request *req, const knot_dname_t *current_cut)
{
struct kr_query *qry = req->current_query;
struct kr_zonecut *cut = &qry->zone_cut;
......@@ -233,8 +234,6 @@ static int update_cut(knot_pkt_t *pkt, const knot_rrset_t *rr, struct kr_request
#endif
}
/* Remember current bailiwick for NS processing. */
const knot_dname_t *current_cut = cut->name;
/* Update zone cut name */
if (!knot_dname_is_equal(rr->owner, cut->name)) {
/* Remember parent cut and descend to new (keep keys and TA). */
......@@ -305,11 +304,13 @@ static int process_authority(knot_pkt_t *pkt, struct kr_request *req)
}
#endif
/* Remember current bailiwick for NS processing. */
const knot_dname_t *current_zone_cut = qry->zone_cut.name;
/* Update zone cut information. */
for (unsigned i = 0; i < ns->count; ++i) {
const knot_rrset_t *rr = knot_pkt_rr(ns, i);
if (rr->type == KNOT_RRTYPE_NS) {
int state = update_cut(pkt, rr, req);
int state = update_cut(pkt, rr, req, current_zone_cut);
switch(state) {
case KR_STATE_DONE: result = state; break;
case KR_STATE_FAIL: return state; break;
......
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