knot_rdataset_t rrs;
void *additional;
};
+struct kr_nsrep {
+ unsigned int score;
+ unsigned int reputation;
+ const knot_dname_t *name;
+ struct kr_context *ctx;
+ /* beware: hidden stub */
+};
struct kr_query {
struct kr_query *parent;
knot_dname_t *sname;
uint16_t reorder;
struct timeval timestamp;
struct kr_zonecut zone_cut;
+ struct kr_nsrep ns;
+ /* ^hidden stub^ */
char _stub[];
};
struct kr_context {
## Some definitions would need too many deps, so shorten them.
-genResType "struct kr_query" | sed '/struct kr_nsrep/,$ d'
-printf "\tchar _stub[];\n};\n"
+genResType "struct kr_nsrep" | sed '/union/,$ d'
+printf "\t/* beware: hidden stub */\n};\n"
+
+genResType "struct kr_query" | sed '/struct kr_layer_pickle/,$ d'
+printf "\t/* ^hidden stub^ */\n\tchar _stub[];\n};\n"
genResType "struct kr_context" | sed '/struct kr_cache/,$ d'
printf "\tchar _stub[];\n};\n"
}))
end
+-- Issue #139: When asking NSs of certain turktelekom names for PTR, disable 0x20.
+-- Just listing the *.in-addr.arpa suffixes would be tedious, as there are many.
+M.layer = {
+ produce = function (state, req)
+ local req = kres.request_t(req)
+ local qry = req:current()
+ if qry.stype ~= kres.type.PTR
+ or bit.band(state, bit.bor(kres.FAIL, kres.DONE)) ~= 0
+ then return state -- quick exit in most cases
+ end
+ if qry:hasflag(kres.query.AWAIT_CUT) or qry.ns.name == nil
+ then return state end
+ local name = kres.dname2str(qry.ns.name)
+ -- The problematic nameservers: rdnsN.turktelekom.com.tr.
+ if name and string.sub(name, 6) == '.turktelekom.com.tr.' then
+ qry.flags = bit.bor(qry.flags,
+ bit.bor(kres.query.NO_0X20, kres.query.NO_MINIMIZE))
+ -- ^ NO_MINIMIZE isn't required for success, as kresd will retry
+ -- after getting refused, but it will speed things up.
+ end
+ return state
+ end,
+}
+
return M