In particular, non-support of EDNS is implied iff FORMERR without OPT
comes. If OPT is there, one possibility is that there was something
wrong in the OPT that *we* sent, but it seems much more likely that
this particular server is just bad and we want to try another one.
https://tools.ietf.org/html/rfc6891#section-7
In particular, we would be in trouble if we dropped OPT in a zone
that is covered by DNSSEC.
break;
case KNOT_RCODE_FORMERR:
ret = KR_STATE_FAIL;
- selection_error = KR_SELECTION_FORMERR;
+ if (knot_pkt_has_edns(pkt)) {
+ selection_error = KR_SELECTION_FORMERR_EDNS;
+ } else {
+ selection_error = KR_SELECTION_FORMERR;
+ }
break;
case KNOT_RCODE_NOTIMPL:
ret = KR_STATE_FAIL;
X(REFUSED);
X(SERVFAIL);
X(FORMERR);
+ X(FORMERR_EDNS);
X(NOTIMPL);
X(OTHER_RCODE);
X(MALFORMED);
qry->flags.NO_EDNS = true;
}
break;
+ case KR_SELECTION_FORMERR_EDNS:
+ addr_state->broken = true;
+ break;
case KR_SELECTION_MISMATCHED:
if (qry->flags.NO_0X20 && qry->flags.TCP) {
addr_state->broken = true;
// RCODEs
KR_SELECTION_REFUSED,
KR_SELECTION_SERVFAIL,
- KR_SELECTION_FORMERR,
+ KR_SELECTION_FORMERR, /// inside an answer without an OPT record
+ KR_SELECTION_FORMERR_EDNS, /// with an OPT record
KR_SELECTION_NOTIMPL,
KR_SELECTION_OTHER_RCODE,
-Subproject commit 63b699aac11583da61647b8d1d920745b053dd66
+Subproject commit ff1e8471785cedada669bf2304442ac0e86b7988