]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
Added a commentary.
authorKarel Slany <karel.slany@nic.cz>
Wed, 13 Jul 2016 08:50:11 +0000 (10:50 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 11 Aug 2016 12:06:45 +0000 (14:06 +0200)
lib/cookies/helper.c

index 5e070404972870930554046aa28feec5be1df539..161b56c6a9f3953feb9b854f6d863e3767c8d339 100644 (file)
@@ -222,6 +222,15 @@ int kr_answer_write_cookie(const struct knot_sc_private *srvr_data,
 
 int kr_pkt_set_ext_rcode(knot_pkt_t *pkt, uint16_t whole_rcode)
 {
+       /*
+        * RFC6891 6.1.3 -- extended RCODE forms the upper 8 bits of whole
+        * 12-bit RCODE (together with the 4 bits of 'normal' RCODE).
+        *
+        * | 11 10 09 08 07 06 05 04 | 03 02 01 00 |
+        * |          12-bit whole RCODE           |
+        * |   8-bit extended RCODE  | 4-bit RCODE |
+        */
+
        if (!pkt || !knot_pkt_has_edns(pkt)) {
                return kr_error(EINVAL);
        }