]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Removed or rephrased some comments.
authorKarel Slany <karel.slany@nic.cz>
Tue, 9 Aug 2016 11:00:48 +0000 (13:00 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 11 Aug 2016 12:06:45 +0000 (14:06 +0200)
modules/cookies/cookiemonster.c

index 6053846294c45da75e1fef84fcd7d352f2d30973..464c943e02a449533bfcaf6fd6f0c328ade14302 100644 (file)
@@ -329,7 +329,7 @@ static int invalid_sc_status(int state, bool sc_present, bool ignore_badcookie,
                        kr_pkt_set_ext_rcode(answer, KNOT_RCODE_BADCOOKIE);
                        state |= KNOT_STATE_FAIL;
                }
-       } else if (!ignore_badcookie) { /* TODO -- Silently discard? */
+       } else if (!ignore_badcookie) {
                /* Generate BADCOOKIE response. */
                DEBUG_MSG(NULL, "%s\n",
                          !sc_present ? "request is missing server cookie" :
@@ -367,11 +367,6 @@ int check_request(knot_layer_t *ctx, void *module_param)
                return ctx->state;
        }
 
-       /*
-        * TODO -- Would it be of any benefit to know whether the request came
-        * via TCP?
-        */
-
        uint8_t *req_cookie_opt = req_cookie_option(req);
        if (!req_cookie_opt) {
                return ctx->state; /* Don't do anything without cookies. */
@@ -386,7 +381,12 @@ int check_request(knot_layer_t *ctx, void *module_param)
                return KNOT_STATE_FAIL | KNOT_STATE_DONE;
        }
 
-       bool ignore_badcookie = true; /* TODO -- Occasionally ignore? */
+       /*
+        * RFC7873 5.2.3 and 5.2.4 suggest that queries with invalid or
+        * missing server cookies can be treated like normal.
+        * Right now bad cookies are always ignored (i.e. treated as valid).
+        */
+       bool ignore_badcookie = true;
 
        const struct knot_sc_alg *current_sc_alg = kr_sc_alg_get(srvr_sett->current.alg_id);