]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4462. [bug] Don't describe a returned EDNS COOKIE as "good"
authorMark Andrews <marka@isc.org>
Thu, 8 Sep 2016 01:34:19 +0000 (11:34 +1000)
committerMark Andrews <marka@isc.org>
Thu, 8 Sep 2016 01:35:11 +0000 (11:35 +1000)
                        when there isn't a valid server cookie. [RT #43167]

(cherry picked from commit 58d622d96dcb1a1d0b9a212782d329e60e24d1c3)

CHANGES
lib/dns/message.c

diff --git a/CHANGES b/CHANGES
index 0d3ff0dc35716f85a017093c2d124ba63d3b3d2a..56120a310db5a6404ba801e3acb3d6001acbb457 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4462.  [bug]           Don't describe a returned EDNS COOKIE as "good"
+                       when there isn't a valid server cookie. [RT #43167]
+
 4461.  [bug]           win32: not all external data was properly marked
                        as external data for windows dll. [RT #43161]
 
index a4f52ea2e3422ce3015e06701de459a803cf4033..96f1bcb7236e28e8031160fee876c8fdf070b585 100644 (file)
@@ -3426,8 +3426,21 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
                                isc_buffer_forward(&optbuf, optlen);
 
                                if (optcode == DNS_OPT_COOKIE) {
-                                       if (msg->cc_ok)
+                                       /*
+                                        * Valid server cookie?
+                                        */
+                                       if (msg->cc_ok && optlen >= 16)
                                                ADD_STRING(target, " (good)");
+                                       /*
+                                        * Server cookie is not valid but
+                                        * we had our cookie echoed back.
+                                        */
+                                       if (msg->cc_ok && optlen < 16)
+                                               ADD_STRING(target, " (echoed)");
+                                       /*
+                                        * We didn't get our cookie echoed
+                                        * back.
+                                        */
                                        if (msg->cc_bad)
                                                ADD_STRING(target, " (bad)");
                                        ADD_STRING(target, "\n");