[v9_6] check for physical equivalence in names

3599.	[tuning]	Check for pointer equivalence in name comparisons.
			[RT #18125]
(cherry picked from commit 7c2f548141)
(cherry picked from commit 9c971268d4)
This commit is contained in:
Evan Hunt
2013-06-18 18:15:42 -07:00
parent f212c720b2
commit 6f8bc655a4
2 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
3599. [tuning] Check for pointer equivalence in name comparisons.
[RT #18125]
3594. [maint] Update config.guess and config.sub. [RT #33816]
3592. [doc] Moved documentation of rndc command options to the

View File

@@ -577,6 +577,11 @@ dns_name_fullcompare(const dns_name_t *name1, const dns_name_t *name2,
REQUIRE((name1->attributes & DNS_NAMEATTR_ABSOLUTE) ==
(name2->attributes & DNS_NAMEATTR_ABSOLUTE));
if (name1 == name2) {
*orderp = 0;
return (dns_namereln_equal);
}
SETUP_OFFSETS(name1, offsets1, odata1);
SETUP_OFFSETS(name2, offsets2, odata2);
@@ -690,6 +695,9 @@ dns_name_equal(const dns_name_t *name1, const dns_name_t *name2) {
REQUIRE((name1->attributes & DNS_NAMEATTR_ABSOLUTE) ==
(name2->attributes & DNS_NAMEATTR_ABSOLUTE));
if (name1 == name2)
return (ISC_TRUE);
if (name1->length != name2->length)
return (ISC_FALSE);