mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:15:18 +00:00
1995. [bug] 'host' was reporting multiple "is an alias" messages.
[RT #15702]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
1995. [bug] 'host' was reporting multiple "is an alias" messages.
|
||||||
|
[RT #15702]
|
||||||
|
|
||||||
1994. [port] OpenSSL 0.9.8 support. [RT #15694]
|
1994. [port] OpenSSL 0.9.8 support. [RT #15694]
|
||||||
|
|
||||||
1993. [bug] Log messsage, via syslog, were missing the space
|
1993. [bug] Log messsage, via syslog, were missing the space
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: host.c,v 1.106 2005/08/25 00:40:49 marka Exp $ */
|
/* $Id: host.c,v 1.107 2006/03/02 01:45:46 marka Exp $ */
|
||||||
|
|
||||||
/*! \file */
|
/*! \file */
|
||||||
|
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <dns/rdataclass.h>
|
#include <dns/rdataclass.h>
|
||||||
#include <dns/rdataset.h>
|
#include <dns/rdataset.h>
|
||||||
#include <dns/rdatatype.h>
|
#include <dns/rdatatype.h>
|
||||||
|
#include <dns/rdatastruct.h>
|
||||||
|
|
||||||
#include <dig/dig.h>
|
#include <dig/dig.h>
|
||||||
|
|
||||||
@@ -355,6 +356,32 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset, dns_name_t *owner,
|
|||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
|
||||||
|
isc_result_t result;
|
||||||
|
dns_rdataset_t *rdataset;
|
||||||
|
dns_rdata_cname_t cname;
|
||||||
|
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||||
|
unsigned int i = msg->counts[DNS_SECTION_ANSWER];
|
||||||
|
|
||||||
|
while (i-- > 0) {
|
||||||
|
rdataset = NULL;
|
||||||
|
result = dns_message_findname(msg, DNS_SECTION_ANSWER, qname,
|
||||||
|
dns_rdatatype_cname, 0, NULL,
|
||||||
|
&rdataset);
|
||||||
|
if (result != ISC_R_SUCCESS)
|
||||||
|
return;
|
||||||
|
result = dns_rdataset_first(rdataset);
|
||||||
|
check_result(result, "dns_rdataset_first");
|
||||||
|
dns_rdata_reset(&rdata);
|
||||||
|
dns_rdataset_current(rdataset, &rdata);
|
||||||
|
result = dns_rdata_tostruct(&rdata, &cname, NULL);
|
||||||
|
check_result(result, "dns_rdata_tostruct");
|
||||||
|
dns_name_copy(&cname.cname, qname, NULL);
|
||||||
|
dns_rdata_freestruct(&cname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||||
isc_boolean_t did_flag = ISC_FALSE;
|
isc_boolean_t did_flag = ISC_FALSE;
|
||||||
@@ -393,10 +420,15 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a) {
|
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a) {
|
||||||
char namestr[DNS_NAME_FORMATSIZE];
|
char namestr[DNS_NAME_FORMATSIZE];
|
||||||
dig_lookup_t *lookup;
|
dig_lookup_t *lookup;
|
||||||
|
dns_fixedname_t fixed;
|
||||||
|
dns_name_t *name;
|
||||||
|
|
||||||
/* Add AAAA and MX lookups. */
|
/* Add AAAA and MX lookups. */
|
||||||
|
dns_fixedname_init(&fixed);
|
||||||
dns_name_format(query->lookup->name, namestr, sizeof(namestr));
|
name = dns_fixedname_name(&fixed);
|
||||||
|
dns_name_copy(query->lookup->name, name, NULL);
|
||||||
|
chase_cnamechain(msg, name);
|
||||||
|
dns_name_format(name, namestr, sizeof(namestr));
|
||||||
lookup = clone_lookup(query->lookup, ISC_FALSE);
|
lookup = clone_lookup(query->lookup, ISC_FALSE);
|
||||||
if (lookup != NULL) {
|
if (lookup != NULL) {
|
||||||
strncpy(lookup->textname, namestr,
|
strncpy(lookup->textname, namestr,
|
||||||
|
Reference in New Issue
Block a user