core: implement setting MDNS setting for systemd

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

The connection.mdns setting is a per-connection setting, so one might expect that one activated device can only have one MDNS setting at a time.

However, with certain VPN plugins (those that don't have their own IP interface, like libreswan), the VPN configuration is merged into the configuration of the device. So, in this case, there might be multiple settings for one device that must be merged.

We already have a mechanism for that. It's NMIP4Config. Let NMIP4Config track this piece of information. Although, stricitly speaking this is not tied to IPv4, the alternative would be to introduce a new object to track such data, which would be a tremendous effort and more complicated then this.

Luckily, NMDnsManager and NMDnsPlugin are already equipped to handle multiple NMIPConfig instances per device (IPv4 vs. IPv6, and Device vs. VPN).

Also make "connection.mdns" configurable via global defaults in NetworkManager.conf.

c03a53496 core: implement setting MDNS setting for systemd
man/NetworkManager.conf.xml | 3 ++
src/devices/nm-device.c | 32 ++++++++++++++++++++++
src/devices/nm-device.h | 1 +
src/dns/nm-dns-systemd-resolved.c | 31 +++++++++++++++++++--
src/nm-ip4-config.c | 32 ++++++++++++++++++++++
src/nm-ip4-config.h | 7 +++++
.../plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 3 +-
src/vpn/nm-vpn-connection.c | 3 ++
8 files changed, 108 insertions(+), 4 deletions(-)


  • Share