[v9_8] check for physical equivalence in names
3599. [tuning] Check for pointer equivalence in name comparisons.
[RT #18125]
(cherry picked from commit 7c2f548141)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -578,6 +578,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);
|
||||
|
||||
@@ -691,6 +696,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user