The suffix returned by dns_compress_findglobal() is never used, so remove it.

This commit is contained in:
Brian Wellington
2001-02-12 18:07:52 +00:00
parent 0c264c9094
commit 29daf5bc77
3 changed files with 10 additions and 18 deletions
+5 -8
View File
@@ -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);
}
+3 -6
View File
@@ -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
+2 -4
View File
@@ -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 <config.h>
@@ -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;