dns-domain: tweak hash table comparison function for DNS names
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Sep 2024 15:00:04 +0000 (17:00 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 23 Oct 2024 08:22:28 +0000 (10:22 +0200)
commit8ed2c62d46f93c2117d65a908c316a381073af16
treedbc7a10e0501eb5077ae9fe37e131824232d013d
parent87d6a9fb2e5679922eb3dc2887bd831b9317ff10
dns-domain: tweak hash table comparison function for DNS names

Currently, when comparing two DNS names when storing them in a
hashtable, and the DNS names are not actually valid we'll compare the
error codes.

This is not very smart however, since this means two invalid DNS names
that happen to be equally "invalid" will be considered identical, even
if their strings are entirely different.

Let's find a better solution for this niche case: let's simple compare
the domains as strings.

This matters in case of DNS label compression: if we already added added
an invalid DNS name into the label compression hash table, and lookup
any other invalid DNS name, this lookup will likely return what the
earlier one already returned, and that's confusing.
src/shared/dns-domain.c