]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1198. [bug] OPT printing style was not consistant with the way the
authorMark Andrews <marka@isc.org>
Mon, 11 Feb 2002 02:03:23 +0000 (02:03 +0000)
committerMark Andrews <marka@isc.org>
Mon, 11 Feb 2002 02:03:23 +0000 (02:03 +0000)
                        header fields are printed.  "do" was not reported if
                        set.  Report is any of the MBZ bits are set.

CHANGES
lib/dns/message.c

diff --git a/CHANGES b/CHANGES
index aaf22c55fb4303056c3558b6867d2a2e21e7e5cb..265c8461baa3db642075202f1a73dc9bd6f4c70b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1198.  [bug]           OPT printing style was not consistant with the way the
+                       header fields are printed.  "do" was not reported if
+                       set.  Report is any of the MBZ bits are set.
+
 1197.  [bug]           Attempts to define the same acl multiple times were not
                        detected.
 
index ffc6996337f3496ccede74d6215b5e0153e52765..2011e9f294177a097514fcae8d3291542b787e42 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: message.c,v 1.205 2002/02/06 04:20:23 marka Exp $ */
+/* $Id: message.c,v 1.206 2002/02/11 02:03:23 marka Exp $ */
 
 /***
  *** Imports
@@ -2935,6 +2935,7 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
        dns_name_t *name = NULL;
        isc_result_t result;
        char buf[sizeof("1234567890")];
+       isc_uint32_t mbz;
 
        REQUIRE(DNS_MESSAGE_VALID(msg));
        REQUIRE(target != NULL);
@@ -2948,13 +2949,22 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
                if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
                        ADD_STRING(target, ";; OPT PSEUDOSECTION:\n");
                ADD_STRING(target, "; EDNS: version: ");
-               sprintf(buf, "%4u",
-                       (unsigned int)((ps->ttl &
+               snprintf(buf, sizeof(buf), "%u",
+                        (unsigned int)((ps->ttl &
                                        0x00ff0000 >> 16)));
                ADD_STRING(target, buf);
-               ADD_STRING(target, ", udp=");
-               sprintf(buf, "%7u\n",
-                       (unsigned int)ps->rdclass);
+               ADD_STRING(target, ", flags:");
+               if ((ps->ttl & DNS_MESSAGEEXTFLAG_DO) != 0)
+                       ADD_STRING(target, " do");
+               mbz = ps->ttl & ~DNS_MESSAGEEXTFLAG_DO & 0xffff;
+               if (mbz != 0) {
+                       ADD_STRING(target, "; MBZ: ");
+                       snprintf(buf, sizeof(buf), "%.4x ", mbz);
+                       ADD_STRING(target, buf);
+                       ADD_STRING(target, ", udp: ");
+               } else
+                       ADD_STRING(target, "; udp: ");
+               snprintf(buf, sizeof(buf), "%u\n", (unsigned int)ps->rdclass);
                ADD_STRING(target, buf);
                return (ISC_R_SUCCESS);
        case DNS_PSEUDOSECTION_TSIG: