if (res < 0 && owner && qry && qry->stale_cb) {
/* Stale-serving decision, delegated to a callback. */
int res_stale = qry->stale_cb(res, owner, type, qry);
- if (res_stale >= 0)
+ if (res_stale >= 0) {
+ VERBOSE_MSG(qry, "responding with stale answer\n");
+ /* LATER: Perhaps we could use a more specific Stale
+ * NXDOMAIN Answer code for applicable responses. */
+ kr_request_set_extended_error(qry->request, KNOT_EDNS_EDE_STALE, NULL);
return res_stale;
+ }
}
return res;
}
case KNOT_EDNS_EDE_DS_DIGEST:
return 500; /* Non-critical DNSSEC issues */
case KNOT_EDNS_EDE_STALE:
+ case KNOT_EDNS_EDE_STALE_NXD:
+ return 300; /* Serve-stale answers. */
case KNOT_EDNS_EDE_INDETERMINATE:
case KNOT_EDNS_EDE_CACHED_ERR:
case KNOT_EDNS_EDE_NOT_READY:
- case KNOT_EDNS_EDE_STALE_NXD:
case KNOT_EDNS_EDE_NOTAUTH:
case KNOT_EDNS_EDE_NOTSUP:
case KNOT_EDNS_EDE_NREACH_AUTH: