]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
utils: use knsupdate style of output when printing UPDATE message
authorJan Hák <jan.hak@nic.cz>
Wed, 18 Dec 2024 09:54:19 +0000 (10:54 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 18 Dec 2024 12:13:09 +0000 (13:13 +0100)
src/utils/common/exec.c

index 798ae421f75186c01c10ab15c78ae0d869735fc9..b91cc605a2d3e63e9b0d0c081c84e8ffc881a78a 100644 (file)
@@ -1133,7 +1133,9 @@ void print_packet(const knot_pkt_t *packet,
        }
 
        // Print DNS sections.
-       switch (style->format) {
+       format_t format = (knot_wire_get_opcode(packet->wire) == KNOT_OPCODE_UPDATE)
+                         ? FORMAT_NSUPDATE : style->format;
+       switch (format) {
        case FORMAT_DIG:
                if (ancount > 0) {
                        print_section_dig(knot_pkt_rr(answers, 0), ancount, style);