NetworkManager/src/dns
Thomas Haller 5902f1c91f
dns: cleanup handling of shadowed priorities rebuild_domain_lists()
domain_is_shadowed() only works, because we pre-sort all items. When
we call domain_is_shadowed(), then "priority" must be not smaller than
any priority already in the dictionary.

Let's add an nm_assert() for that.

While at it, I also found it ugly to rely on

  GPOINTER_TO_INT(g_hash_table_lookup(ht, domain))

returning zero to know whether the domain is tracked. While more
cumbersome, we should check whether the value is in the hash (and not).
Not whether the value does not translate to zero.

Add domain_ht_get_priority() for that.
2020-11-20 16:59:56 +01:00
..
nm-dns-dnsmasq.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dns-dnsmasq.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dns-manager.c dns: cleanup handling of shadowed priorities rebuild_domain_lists() 2020-11-20 16:59:56 +01:00
nm-dns-manager.h dns: track NMDnsConfigData as keys of a dictionary 2020-11-20 16:59:56 +01:00
nm-dns-plugin.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dns-plugin.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dns-systemd-resolved.c dns: sd-resolved: fix hash table initialization 2020-11-06 23:39:46 +01:00
nm-dns-systemd-resolved.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dns-unbound.c all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00
nm-dns-unbound.h all: unify comment style for SPDX-License-Identifier tag 2020-09-29 16:50:53 +02:00