Commit 94a08e09 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

Check for edns1 and strict decompression once and for all in

dns_[de]compress_setmethods instead of separately in every caller
parent fd63a046
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: compress.c,v 1.30 2000/05/02 03:53:52 tale Exp $ */
/* $Id: compress.c,v 1.31 2000/05/04 22:19:00 gson Exp $ */
#define DNS_NAME_USEINLINE 1
......@@ -224,7 +224,10 @@ dns_decompress_setmethods(dns_decompress_t *dctx, unsigned int allowed) {
REQUIRE(VALID_DCTX(dctx));
dctx->allowed = allowed;
if (dns_decompress_strict(dctx))
dctx->allowed = allowed;
else
dctx->allowed = DNS_COMPRESS_ALL;
}
unsigned int
......
......@@ -1375,11 +1375,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
*/
dns_decompress_init(&dctx, -1, ISC_FALSE);
if (dns_decompress_edns(&dctx) > 1 || !dns_decompress_strict(&dctx))
dns_decompress_setmethods(&dctx, DNS_COMPRESS_GLOBAL);
else
dns_decompress_setmethods(&dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(&dctx, DNS_COMPRESS_GLOBAL14);
ret = getquestions(source, msg, &dctx);
if (ret != ISC_R_SUCCESS)
......
......@@ -280,11 +280,6 @@ dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx,
INSIST(dns_rdataset_next(rdataset) == ISC_R_NOMORE);
isc_buffer_init(&source, rdata.data, rdata.length);
isc_buffer_add(&source, rdata.length);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
savedbuffer = *target;
......@@ -320,6 +315,7 @@ dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx,
/*
* Write the name.
*/
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
result = dns_name_towire(&name, cctx, target);
if (result != ISC_R_SUCCESS)
goto rollback;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: tsig_250.c,v 1.31 2000/04/28 22:40:08 tale Exp $ */
/* $Id: tsig_250.c,v 1.32 2000/05/04 22:19:05 gson Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
......@@ -201,10 +201,7 @@ fromwire_any_tsig(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 250);
REQUIRE(rdclass == 255);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
/* Algorithm Name */
dns_name_init(&name, NULL);
......@@ -255,11 +252,7 @@ towire_any_tsig(dns_rdata_t *rdata, dns_compress_t *cctx,
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_rdata_toregion(rdata, &sr);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, &sr);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: afsdb_18.c,v 1.23 2000/04/28 01:23:59 gson Exp $ */
/* $Id: afsdb_18.c,v 1.24 2000/05/04 22:19:06 gson Exp $ */
/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */
......@@ -90,10 +90,7 @@ fromwire_afsdb(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 18);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
......@@ -118,11 +115,7 @@ towire_afsdb(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 18);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
isc_buffer_availableregion(target, &tr);
dns_rdata_toregion(rdata, &sr);
if (tr.length < 2)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cname_5.c,v 1.27 2000/04/28 01:24:00 gson Exp $ */
/* $Id: cname_5.c,v 1.28 2000/05/04 22:19:07 gson Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
......@@ -78,10 +78,7 @@ fromwire_cname(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -95,10 +92,7 @@ towire_cname(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 5);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dname_39.c,v 1.19 2000/04/28 01:24:00 gson Exp $ */
/* $Id: dname_39.c,v 1.20 2000/05/04 22:19:09 gson Exp $ */
/* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */
......@@ -80,10 +80,7 @@ fromwire_dname(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 39);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
return(dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -97,11 +94,7 @@ towire_dname(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 39);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
dns_name_fromregion(&name, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mb_7.c,v 1.26 2000/04/28 01:24:03 gson Exp $ */
/* $Id: mb_7.c,v 1.27 2000/05/04 22:19:10 gson Exp $ */
/* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */
......@@ -78,10 +78,7 @@ fromwire_mb(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 7);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -94,10 +91,7 @@ towire_mb(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(rdata->type == 7);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: md_3.c,v 1.28 2000/04/28 01:24:03 gson Exp $ */
/* $Id: md_3.c,v 1.29 2000/05/04 22:19:11 gson Exp $ */
/* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */
......@@ -78,10 +78,7 @@ fromwire_md(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 3);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -94,10 +91,7 @@ towire_md(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(rdata->type == 3);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mf_4.c,v 1.26 2000/04/28 01:24:04 gson Exp $ */
/* $Id: mf_4.c,v 1.27 2000/05/04 22:19:12 gson Exp $ */
/* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */
......@@ -78,10 +78,7 @@ fromwire_mf(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -95,10 +92,7 @@ towire_mf(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 4);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mg_8.c,v 1.24 2000/04/28 01:24:04 gson Exp $ */
/* $Id: mg_8.c,v 1.25 2000/05/04 22:19:14 gson Exp $ */
/* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */
......@@ -78,10 +78,7 @@ fromwire_mg(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -95,10 +92,7 @@ towire_mg(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 8);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: minfo_14.c,v 1.25 2000/04/28 01:24:05 gson Exp $ */
/* $Id: minfo_14.c,v 1.26 2000/05/04 22:19:15 gson Exp $ */
/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
......@@ -94,10 +94,7 @@ fromwire_minfo(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 14);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
UNUSED(rdclass);
......@@ -117,10 +114,7 @@ towire_minfo(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 14);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&rmail, NULL);
dns_name_init(&email, NULL);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mr_9.c,v 1.23 2000/04/28 01:24:05 gson Exp $ */
/* $Id: mr_9.c,v 1.24 2000/05/04 22:19:16 gson Exp $ */
/* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */
......@@ -77,10 +77,7 @@ fromwire_mr(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -93,10 +90,7 @@ towire_mr(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(rdata->type == 9);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mx_15.c,v 1.30 2000/04/28 01:24:05 gson Exp $ */
/* $Id: mx_15.c,v 1.31 2000/05/04 22:19:17 gson Exp $ */
/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
......@@ -88,10 +88,7 @@ fromwire_mx(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
......@@ -111,10 +108,7 @@ towire_mx(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 15);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_rdata_toregion(rdata, &region);
RETERR(mem_tobuffer(target, region.base, 2));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: ns_2.c,v 1.25 2000/04/27 00:02:33 tale Exp $ */
/* $Id: ns_2.c,v 1.26 2000/05/04 22:19:18 gson Exp $ */
/* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */
......@@ -78,10 +78,7 @@ fromwire_ns(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 2);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -94,10 +91,7 @@ towire_ns(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(rdata->type == 2);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nxt_30.c,v 1.30 2000/05/03 23:52:35 gson Exp $ */
/* $Id: nxt_30.c,v 1.31 2000/05/04 22:19:19 gson Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
......@@ -139,10 +139,7 @@ fromwire_nxt(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
RETERR(dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -164,11 +161,7 @@ towire_nxt(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 30);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &sr);
dns_name_fromregion(&name, &sr);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: proforma.c,v 1.21 2000/04/07 03:54:29 explorer Exp $ */
/* $Id: proforma.c,v 1.22 2000/05/04 22:19:20 gson Exp $ */
#ifndef RDATA_GENERIC_#_#_C
#define RDATA_GENERIC_#_#_C
......@@ -55,11 +55,8 @@ fromwire_#(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == #);
REQUIRE(rdclass == #);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
/* NONE or GLOBAL14 */
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
/* NONE or GLOBAL14 */
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
return (ISC_R_NOTIMPLEMENTED);
}
......@@ -70,11 +67,8 @@ towire_#(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(rdata->type == #);
REQUIRE(rdata->rdclass == #);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL):
else
/* NONE or GLOBAL14 */
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
/* NONE or GLOBAL14 */
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
return (ISC_R_NOTIMPLEMENTED);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: ptr_12.c,v 1.24 2000/04/28 01:24:07 gson Exp $ */
/* $Id: ptr_12.c,v 1.25 2000/05/04 22:19:21 gson Exp $ */
/* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */
......@@ -78,10 +78,7 @@ fromwire_ptr(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 12);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
......@@ -95,10 +92,7 @@ towire_ptr(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 12);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rp_17.c,v 1.21 2000/04/28 01:24:08 gson Exp $ */
/* $Id: rp_17.c,v 1.22 2000/05/04 22:19:23 gson Exp $ */
/* RFC 1183 */
......@@ -96,10 +96,7 @@ fromwire_rp(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 17);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_name_init(&rmail, NULL);
dns_name_init(&email, NULL);
......@@ -117,11 +114,7 @@ towire_rp(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 17);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_name_init(&rmail, NULL);
dns_name_init(&email, NULL);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rt_21.c,v 1.21 2000/04/28 01:24:08 gson Exp $ */
/* $Id: rt_21.c,v 1.22 2000/05/04 22:19:24 gson Exp $ */
/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */
......@@ -90,10 +90,7 @@ fromwire_rt(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(type == 21);
UNUSED(rdclass);
if (dns_decompress_edns(dctx) >= 1 || !dns_decompress_strict(dctx))
dns_decompress_setmethods(dctx, DNS_COMPRESS_ALL);
else
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
......@@ -118,11 +115,7 @@ towire_rt(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
REQUIRE(rdata->type == 21);
if (dns_compress_getedns(cctx) >= 1)
dns_compress_setmethods(cctx, DNS_COMPRESS_ALL);
else
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
isc_buffer_availableregion(target, &tr);
dns_rdata_toregion(rdata, &region);
if (tr.length < 2)
......