]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/selection: rename to *_FORMERR for consistency
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 1 Feb 2021 08:57:46 +0000 (09:57 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 1 Feb 2021 08:57:46 +0000 (09:57 +0100)
It's now consistent with KNOT_RCODE_FORMERR and the official name
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6

lib/layer/iterate.c
lib/selection.c
lib/selection.h

index 24f0b04ee0a8a53471d8959a9869506158fbc64f..b1c1ff77f6f93d22fd91c7e8638c745d7158d002 100644 (file)
@@ -1021,10 +1021,10 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt)
 #endif
        if (pkt->parsed <= KNOT_WIRE_HEADER_SIZE) {
                if (pkt->parsed == KNOT_WIRE_HEADER_SIZE && knot_wire_get_rcode(pkt->wire) == KNOT_RCODE_FORMERR) {
-                       /* This is a special case where we get valid header with FORMERROR and nothing else.
+                       /* This is a special case where we get valid header with FORMERR and nothing else.
                         * This happens on some authoritatives which don't support EDNS and don't
                         * bother copying the SECTION QUESTION. */
-                       query->server_selection.error(query, req->upstream.transport, KR_SELECTION_FORMERROR);
+                       query->server_selection.error(query, req->upstream.transport, KR_SELECTION_FORMERR);
                        return KR_STATE_FAIL;
                }
                VERBOSE_MSG("<= malformed response (parsed %d)\n", (int)pkt->parsed);
@@ -1094,7 +1094,7 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt)
                break;
        case KNOT_RCODE_FORMERR:
                ret = KR_STATE_FAIL;
-               selection_error = KR_SELECTION_FORMERROR;
+               selection_error = KR_SELECTION_FORMERR;
                break;
        case KNOT_RCODE_NOTIMPL:
                ret = KR_STATE_FAIL;
index cef4662e83a1fd431e6f74ab7ef7ff1a7521735d..d4925481afbfabaadaa064e75061b66e63e5109e 100644 (file)
@@ -41,7 +41,7 @@ static const char *kr_selection_error_str(enum kr_selection_error err) {
                X(TCP_CONNECT_TIMEOUT);
                X(REFUSED);
                X(SERVFAIL);
-               X(FORMERROR);
+               X(FORMERR);
                X(NOTIMPL);
                X(OTHER_RCODE);
                X(MALFORMED);
@@ -517,7 +517,7 @@ void error(struct kr_query *qry, struct address_state *addr_state,
                                      &qry->request->ctx->cache);
                }
                break;
-       case KR_SELECTION_FORMERROR:
+       case KR_SELECTION_FORMERR:
                if (qry->flags.NO_EDNS) {
                        addr_state->broken = true;
                } else {
index 46fad61d96b42f149c5b0075165ddef8cccb432b..ef7cffd4ae1370f4e5feb1ade32811bc81366925 100644 (file)
@@ -32,7 +32,7 @@ enum kr_selection_error {
        // RCODEs
        KR_SELECTION_REFUSED,
        KR_SELECTION_SERVFAIL,
-       KR_SELECTION_FORMERROR,
+       KR_SELECTION_FORMERR,
        KR_SELECTION_NOTIMPL,
        KR_SELECTION_OTHER_RCODE,