]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
use methods with appropriate rcode/opcode typecasting in Message.to_text()
authorBob Halley <halley@dnspython.org>
Mon, 4 Jan 2021 22:34:45 +0000 (14:34 -0800)
committerBob Halley <halley@dnspython.org>
Mon, 4 Jan 2021 22:34:45 +0000 (14:34 -0800)
dns/message.py

index 131f1f3f00b2f0e850f77c509f8bb17ecd56d19c..2a7565a03c629b8b8473518e78e45a412e9c471a 100644 (file)
@@ -186,10 +186,8 @@ class Message:
 
         s = io.StringIO()
         s.write('id %d\n' % self.id)
-        s.write('opcode %s\n' %
-                dns.opcode.to_text(dns.opcode.from_flags(self.flags)))
-        rc = dns.rcode.from_flags(self.flags, self.ednsflags)
-        s.write('rcode %s\n' % dns.rcode.to_text(rc))
+        s.write('opcode %s\n' % dns.opcode.to_text(self.opcode()))
+        s.write('rcode %s\n' % dns.rcode.to_text(self.rcode()))
         s.write('flags %s\n' % dns.flags.to_text(self.flags))
         if self.edns >= 0:
             s.write('edns %s\n' % self.edns)