From: Karel Slany Date: Wed, 13 Jul 2016 08:50:11 +0000 (+0200) Subject: Added a commentary. X-Git-Tag: v1.1.0~2^2~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d7d52d4325849711bb82d5d2a7dcf8748fc4b23;p=thirdparty%2Fknot-resolver.git Added a commentary. --- diff --git a/lib/cookies/helper.c b/lib/cookies/helper.c index 5e0704049..161b56c6a 100644 --- a/lib/cookies/helper.c +++ b/lib/cookies/helper.c @@ -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); }