mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
add decompression context
This commit is contained in:
@@ -29,6 +29,9 @@
|
|||||||
#include <dns/types.h>
|
#include <dns/types.h>
|
||||||
#include <dns/result.h>
|
#include <dns/result.h>
|
||||||
#include <dns/name.h>
|
#include <dns/name.h>
|
||||||
|
#include <dns/compress.h>
|
||||||
|
|
||||||
|
dns_decompress_t dctx;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_wirename(isc_region_t *name) {
|
print_wirename(isc_region_t *name) {
|
||||||
@@ -83,7 +86,7 @@ getname(isc_buffer_t *source) {
|
|||||||
isc_buffer_init(&text, c, 255, ISC_BUFFERTYPE_TEXT);
|
isc_buffer_init(&text, c, 255, ISC_BUFFERTYPE_TEXT);
|
||||||
|
|
||||||
current = source->current;
|
current = source->current;
|
||||||
result = dns_name_fromwire(&name, source, NULL, ISC_FALSE, &target);
|
result = dns_name_fromwire(&name, source, &dctx, ISC_FALSE, &target);
|
||||||
|
|
||||||
if (result == DNS_R_SUCCESS) {
|
if (result == DNS_R_SUCCESS) {
|
||||||
dns_name_toregion(&name, &r);
|
dns_name_toregion(&name, &r);
|
||||||
@@ -156,6 +159,9 @@ main(int argc, char *argv[]) {
|
|||||||
if (need_close)
|
if (need_close)
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
dctx.allowed = DNS_COMPRESS_GLOBAL14 | DNS_COMPRESS_GLOBAL16;
|
||||||
|
dns_name_init(&dctx.owner_name);
|
||||||
|
|
||||||
isc_buffer_init(&source, b, 255, ISC_BUFFERTYPE_BINARY);
|
isc_buffer_init(&source, b, 255, ISC_BUFFERTYPE_BINARY);
|
||||||
isc_buffer_add(&source, bp - b);
|
isc_buffer_add(&source, bp - b);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user