]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
show actual wire data on highest verbosity level if dns packet contains error
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Wed, 29 Mar 2006 07:50:24 +0000 (07:50 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Wed, 29 Mar 2006 07:50:24 +0000 (07:50 +0000)
examples/ldns-dpa.c

index eb5e5246cf628d3827eae4caf3b35efb1bc615fe..dc919667b2a5a41ce078f405a4a4695147645a47 100644 (file)
@@ -2183,6 +2183,16 @@ printf("timeval: %u ; %u\n", cur_hdr.ts.tv_sec, cur_hdr.ts.tv_usec);
                                        if (verbosity >= 3) {
                                                printf("No dns packet: %s\n", ldns_get_errorstr_by_id(status));
                                        }
+                                       if (verbosity >= 5) {
+                                               for (ip_len = 0; ip_len < len - data_offset; ip_len++) {
+                                                       if (ip_len > 0 && ip_len % 20 == 0) {
+                                                               printf("\t; %u - %u\n", ip_len - 19, ip_len);
+                                                       }
+                                                       printf("%02x ", dnspkt[ip_len]);
+                                               }
+                                               printf("\t; ??? - %u\n", ip_len);
+                                               
+                                       }
                                        bad_dns_packets++;
                                        if (bad_dns_dump) {
                                                pcap_dump((u_char *)bad_dns_dump, &cur_hdr, newdata);