From 29daf5bc7738f1cdab7914562269e1129c81acdc Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 12 Feb 2001 18:07:52 +0000 Subject: [PATCH] The suffix returned by dns_compress_findglobal() is never used, so remove it. --- lib/dns/compress.c | 13 +++++-------- lib/dns/include/dns/compress.h | 9 +++------ lib/dns/name.c | 6 ++---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/lib/dns/compress.c b/lib/dns/compress.c index faacf3d730..4c19085a5c 100644 --- a/lib/dns/compress.c +++ b/lib/dns/compress.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: compress.c,v 1.47 2001/02/10 02:55:05 bwelling Exp $ */ +/* $Id: compress.c,v 1.48 2001/02/12 18:07:50 bwelling Exp $ */ #define DNS_NAME_USEINLINE 1 @@ -114,8 +114,7 @@ do { \ */ isc_boolean_t dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name, - dns_name_t *prefix, dns_name_t *suffix, - isc_uint16_t *offset) + dns_name_t *prefix, isc_uint16_t *offset) { dns_name_t tname, nname; dns_compressnode_t *node = NULL; @@ -154,13 +153,11 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name, if (node == NULL) return (ISC_FALSE); - if (n == 0) { - dns_name_clone(name, suffix); + if (n == 0) dns_name_reset(prefix); - } else { - dns_name_clone(&tname, suffix); + else dns_name_getlabelsequence(name, 0, n, prefix); - } + *offset = node->offset; return (ISC_TRUE); } diff --git a/lib/dns/include/dns/compress.h b/lib/dns/include/dns/compress.h index 5938507483..fc5836de32 100644 --- a/lib/dns/include/dns/compress.h +++ b/lib/dns/include/dns/compress.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: compress.h,v 1.28 2001/02/09 02:13:07 bwelling Exp $ */ +/* $Id: compress.h,v 1.29 2001/02/12 18:07:52 bwelling Exp $ */ #ifndef DNS_COMPRESS_H #define DNS_COMPRESS_H 1 @@ -137,8 +137,7 @@ dns_compress_getedns(dns_compress_t *cctx); isc_boolean_t dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name, - dns_name_t *prefix, dns_name_t *suffix, - isc_uint16_t *offset); + dns_name_t *prefix, isc_uint16_t *offset); /* * Finds longest possible match of 'name' in the global compression table. * @@ -146,12 +145,10 @@ dns_compress_findglobal(dns_compress_t *cctx, dns_name_t *name, * 'cctx' to be initialized. * 'name' to be a absolute name. * 'prefix' to be initialized. - * 'suffix' to be initialized. * 'offset' to point to an isc_uint16_t. * * Ensures: - * 'prefix', 'suffix' and 'offset' are valid if ISC_TRUE is - * returned. + * 'prefix' and 'offset' are valid if ISC_TRUE is returned. * * Returns: * ISC_TRUE / ISC_FALSE diff --git a/lib/dns/name.c b/lib/dns/name.c index 219ffc83f8..e9693db84d 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.119 2001/02/12 05:22:34 bwelling Exp $ */ +/* $Id: name.c,v 1.120 2001/02/12 18:07:49 bwelling Exp $ */ #include @@ -2359,7 +2359,6 @@ dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) { unsigned int methods; isc_uint16_t offset; dns_name_t gp; /* Global compression prefix */ - dns_name_t gs; /* Global compression suffix */ isc_boolean_t gf; /* Global compression target found */ isc_uint16_t go; /* Global compression offset */ dns_offsets_t clo; @@ -2383,14 +2382,13 @@ dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) { name = &clname; } DNS_NAME_INIT(&gp, NULL); - DNS_NAME_INIT(&gs, NULL); offset = target->used; /*XXX*/ methods = dns_compress_getmethods(cctx); if ((methods & DNS_COMPRESS_GLOBAL14) != 0) - gf = dns_compress_findglobal(cctx, name, &gp, &gs, &go); + gf = dns_compress_findglobal(cctx, name, &gp, &go); else gf = ISC_FALSE;