core: rework tracking config in dns-manager to use ifindex

System Internals / NetworkManager - Thomas Haller [] - 9 January 2018 13:24 EST

Don't track the per-device configuration in NMDnsManager by the ifname, but by the ifindex. We should consistently treat the ifindex as the ID of a link, like kernel does.

At the few places where we actually need the ifname, resolve it by looking into the platform cache. That is not necessarily the same as the ifname that is currently tracked by NMDevice, because netdev interfaces can be renamed, and NMDevice updates it's link properties delayed. However, the platform cache has the most recent notion of the correct interface name for an ifindex, so if we ever hit a race here, we do it now more correctly.

This also temporarily drops support for mdns. Will be re-added next, but differently.

b40729ca5 core: rework tracking config in dns-manager to use ifindex
src/dns/nm-dns-dnsmasq.c | 131 +++++----
src/dns/nm-dns-manager.c | 586 +++++++++++++++++---------------------
src/dns/nm-dns-manager.h | 42 ++-
src/dns/nm-dns-plugin.c | 16 +-
src/dns/nm-dns-plugin.h | 13 +-
src/dns/nm-dns-systemd-resolved.c | 59 +---
src/dns/nm-dns-unbound.c | 2 +-
src/nm-ip4-config.h | 6 +
src/nm-policy.c | 117 ++------
9 files changed, 391 insertions(+), 581 deletions(-)


  • Share