From: Grigorii Demidov Date: Thu, 19 Jan 2017 16:22:43 +0000 (+0100) Subject: lib/resolve: bugfix in zonecut fetching process X-Git-Tag: v1.2.0-rc2~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eb8cc6fb511b5bd52faee4c7c2dc12f78eb571b;p=thirdparty%2Fknot-resolver.git lib/resolve: bugfix in zonecut fetching process --- diff --git a/lib/resolve.c b/lib/resolve.c index a8d47f8ae..392afb35d 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -251,8 +251,18 @@ static int ns_fetch_cut(struct kr_query *qry, const knot_dname_t *requested_name * from authoritative, but we have no key to verify it. * TODO - try to refetch cut only if no glue were fetched */ kr_zonecut_deinit(&cut_found); - /* Try next label */ - return KR_STATE_CONSUME; + if (requested_name[0] != '\0' ) { + /* If not root - try next label */ + return KR_STATE_CONSUME; + } + /* No cached cut & keys found, start from SBELT */ + ret = kr_zonecut_set_sbelt(req->ctx, &qry->zone_cut); + if (ret != 0) { + return KR_STATE_FAIL; + } + VERBOSE_MSG(qry, "=> using root hints\n"); + qry->flags &= ~QUERY_AWAIT_CUT; + return KR_STATE_DONE; } /* Copy fetched name */ qry->zone_cut.name = knot_dname_copy(cut_found.name, qry->zone_cut.pool);