Commit 25906eda authored by Ismo Puustinen's avatar Ismo Puustinen Committed by Thomas Haller
Browse files

dns: add mechanism for propagating mDNS setting.

Update nm-policy.c and nm-dns-manager.c so that the connection-specific
settings get propagated to DNS manger. Currently the only such value is
the mDNS status.

Add update_mdns() function to DNS plugin interface. If a DNS plugin
supports mDNS, it can set an interface with a given index to support
mDNS resolving or also register the current hostname.

The mDNS support is currently added only to systemd-resolved DNS plugin.
parent 2e2ff6f2
...@@ -103,7 +103,8 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMDnsManager, ...@@ -103,7 +103,8 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMDnsManager,
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
typedef struct { typedef struct {
GPtrArray *configs; GPtrArray *ip_configs;
GPtrArray *connection_configs;
GVariant *config_variant; GVariant *config_variant;
NMDnsIPConfigData *best_conf4, *best_conf6; NMDnsIPConfigData *best_conf4, *best_conf6;
...@@ -214,6 +215,19 @@ ip_config_data_new (gpointer config, NMDnsIPConfigType type, const char *iface) ...@@ -214,6 +215,19 @@ ip_config_data_new (gpointer config, NMDnsIPConfigType type, const char *iface)
return data; return data;
} }
static NMDnsConnectionConfigData *
connection_config_data_new (NMSettingConnectionMdns mdns, const char *iface, int ifindex)
{
NMDnsConnectionConfigData *data;
data = g_slice_new0 (NMDnsConnectionConfigData);
data->mdns = mdns;
data->iface = g_strdup (iface);
data->ifindex = ifindex;
return data;
}
static void static void
ip_config_data_destroy (gpointer ptr) ip_config_data_destroy (gpointer ptr)
{ {
...@@ -227,6 +241,18 @@ ip_config_data_destroy (gpointer ptr) ...@@ -227,6 +241,18 @@ ip_config_data_destroy (gpointer ptr)
g_slice_free (NMDnsIPConfigData, data); g_slice_free (NMDnsIPConfigData, data);
} }
static void
connection_config_data_destroy (gpointer ptr)
{
NMDnsConnectionConfigData *data = ptr;
if (!data)
return;
g_free (data->iface);
g_slice_free (NMDnsConnectionConfigData, data);
}
static gint static gint
ip_config_data_compare (const NMDnsIPConfigData *a, const NMDnsIPConfigData *b) ip_config_data_compare (const NMDnsIPConfigData *a, const NMDnsIPConfigData *b)
{ {
...@@ -833,8 +859,8 @@ compute_hash (NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer ...@@ -833,8 +859,8 @@ compute_hash (NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer
if (global) if (global)
nm_global_dns_config_update_checksum (global, sum); nm_global_dns_config_update_checksum (global, sum);
else { else {
for (i = 0; i < priv->configs->len; i++) { for (i = 0; i < priv->ip_configs->len; i++) {
NMDnsIPConfigData *data = priv->configs->pdata[i]; NMDnsIPConfigData *data = priv->ip_configs->pdata[i];
if (NM_IS_IP4_CONFIG (data->config)) if (NM_IS_IP4_CONFIG (data->config))
nm_ip4_config_hash ((NMIP4Config *) data->config, sum, TRUE); nm_ip4_config_hash ((NMIP4Config *) data->config, sum, TRUE);
...@@ -916,7 +942,7 @@ _ptrarray_to_strv (GPtrArray *parray) ...@@ -916,7 +942,7 @@ _ptrarray_to_strv (GPtrArray *parray)
static void static void
_collect_resolv_conf_data (NMDnsManager *self, /* only for logging context, no other side-effects */ _collect_resolv_conf_data (NMDnsManager *self, /* only for logging context, no other side-effects */
NMGlobalDnsConfig *global_config, NMGlobalDnsConfig *global_config,
const GPtrArray *configs, const GPtrArray *ip_configs,
const char *hostname, const char *hostname,
char ***out_searches, char ***out_searches,
char ***out_options, char ***out_options,
...@@ -940,10 +966,10 @@ _collect_resolv_conf_data (NMDnsManager *self, /* only for logging context, no o ...@@ -940,10 +966,10 @@ _collect_resolv_conf_data (NMDnsManager *self, /* only for logging context, no o
int prio, first_prio = 0; int prio, first_prio = 0;
NMDnsIPConfigData *current; NMDnsIPConfigData *current;
for (i = 0; i < configs->len; i++) { for (i = 0; i < ip_configs->len; i++) {
gboolean skip = FALSE; gboolean skip = FALSE;
current = configs->pdata[i]; current = ip_configs->pdata[i];
prio = nm_ip_config_get_dns_priority (current->config); prio = nm_ip_config_get_dns_priority (current->config);
...@@ -1046,14 +1072,14 @@ update_dns (NMDnsManager *self, ...@@ -1046,14 +1072,14 @@ update_dns (NMDnsManager *self,
global_config = nm_config_data_get_global_dns_config (data); global_config = nm_config_data_get_global_dns_config (data);
if (priv->need_sort) { if (priv->need_sort) {
g_ptr_array_sort (priv->configs, ip_config_data_ptr_compare); g_ptr_array_sort (priv->ip_configs, ip_config_data_ptr_compare);
priv->need_sort = FALSE; priv->need_sort = FALSE;
} }
/* Update hash with config we're applying */ /* Update hash with config we're applying */
compute_hash (self, global_config, priv->hash); compute_hash (self, global_config, priv->hash);
_collect_resolv_conf_data (self, global_config, priv->configs, priv->hostname, _collect_resolv_conf_data (self, global_config, priv->ip_configs, priv->hostname,
&searches, &options, &nameservers, &nis_servers, &nis_domain); &searches, &options, &nameservers, &nis_servers, &nis_domain);
/* Let any plugins do their thing first */ /* Let any plugins do their thing first */
...@@ -1072,7 +1098,7 @@ update_dns (NMDnsManager *self, ...@@ -1072,7 +1098,7 @@ update_dns (NMDnsManager *self,
_LOGD ("update-dns: updating plugin %s", plugin_name); _LOGD ("update-dns: updating plugin %s", plugin_name);
if (!nm_dns_plugin_update (plugin, if (!nm_dns_plugin_update (plugin,
priv->configs, priv->ip_configs,
global_config, global_config,
priv->hostname)) { priv->hostname)) {
_LOGW ("update-dns: plugin %s update failed", plugin_name); _LOGW ("update-dns: plugin %s update failed", plugin_name);
...@@ -1222,7 +1248,7 @@ ip_config_dns_priority_changed (gpointer config, ...@@ -1222,7 +1248,7 @@ ip_config_dns_priority_changed (gpointer config,
} }
static void static void
forget_data (NMDnsManager *self, NMDnsIPConfigData *data) forget_ip_data (NMDnsManager *self, NMDnsIPConfigData *data)
{ {
NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self);
...@@ -1234,6 +1260,40 @@ forget_data (NMDnsManager *self, NMDnsIPConfigData *data) ...@@ -1234,6 +1260,40 @@ forget_data (NMDnsManager *self, NMDnsIPConfigData *data)
g_signal_handlers_disconnect_by_func (data->config, ip_config_dns_priority_changed, self); g_signal_handlers_disconnect_by_func (data->config, ip_config_dns_priority_changed, self);
} }
void nm_dns_manager_update_ifindex (NMDnsManager *self,
const char *iface,
int new_ifindex)
{
NMDnsConnectionConfigData *data;
NMDnsManagerPrivate *priv;
NMDnsPlugin *plugin;
guint i;
g_return_if_fail (NM_IS_DNS_MANAGER (self));
g_return_if_fail (iface && iface[0]);
g_return_if_fail (new_ifindex > 0);
priv = NM_DNS_MANAGER_GET_PRIVATE (self);
plugin = priv->plugin;
for (i = 0; i < priv->connection_configs->len; i++) {
data = priv->connection_configs->pdata[i];
if (nm_streq (data->iface, iface)) {
if (data->ifindex == new_ifindex)
return;
nm_dns_plugin_update_mdns (plugin,
data->ifindex,
NM_SETTING_CONNECTION_MDNS_UNKNOWN);
data->ifindex = new_ifindex;
nm_dns_plugin_update_mdns (plugin,
data->ifindex,
data->mdns);
return;
}
}
}
gboolean gboolean
nm_dns_manager_add_ip_config (NMDnsManager *self, nm_dns_manager_add_ip_config (NMDnsManager *self,
const char *iface, const char *iface,
...@@ -1253,22 +1313,22 @@ nm_dns_manager_add_ip_config (NMDnsManager *self, ...@@ -1253,22 +1313,22 @@ nm_dns_manager_add_ip_config (NMDnsManager *self,
priv = NM_DNS_MANAGER_GET_PRIVATE (self); priv = NM_DNS_MANAGER_GET_PRIVATE (self);
for (i = 0; i < priv->configs->len; i++) { for (i = 0; i < priv->ip_configs->len; i++) {
data = priv->configs->pdata[i]; data = priv->ip_configs->pdata[i];
if (data->config == config) { if (data->config == config) {
if ( nm_streq (data->iface, iface) if ( nm_streq (data->iface, iface)
&& data->type == cfg_type) && data->type == cfg_type)
return FALSE; return FALSE;
else { else {
forget_data (self, data); forget_ip_data (self, data);
g_ptr_array_remove_index_fast (priv->configs, i); g_ptr_array_remove_index_fast (priv->ip_configs, i);
break; break;
} }
} }
} }
data = ip_config_data_new (config, cfg_type, iface); data = ip_config_data_new (config, cfg_type, iface);
g_ptr_array_add (priv->configs, data); g_ptr_array_add (priv->ip_configs, data);
g_signal_connect (config, g_signal_connect (config,
v4 ? v4 ?
"notify::" NM_IP4_CONFIG_DNS_PRIORITY : "notify::" NM_IP4_CONFIG_DNS_PRIORITY :
...@@ -1311,12 +1371,12 @@ nm_dns_manager_remove_ip_config (NMDnsManager *self, gpointer config) ...@@ -1311,12 +1371,12 @@ nm_dns_manager_remove_ip_config (NMDnsManager *self, gpointer config)
priv = NM_DNS_MANAGER_GET_PRIVATE (self); priv = NM_DNS_MANAGER_GET_PRIVATE (self);
for (i = 0; i < priv->configs->len; i++) { for (i = 0; i < priv->ip_configs->len; i++) {
data = priv->configs->pdata[i]; data = priv->ip_configs->pdata[i];
if (data->config == config) { if (data->config == config) {
forget_data (self, data); forget_ip_data (self, data);
g_ptr_array_remove_index (priv->configs, i); g_ptr_array_remove_index (priv->ip_configs, i);
if (!priv->updates_queue && !update_dns (self, FALSE, &error)) { if (!priv->updates_queue && !update_dns (self, FALSE, &error)) {
_LOGW ("could not commit DNS changes: %s", error->message); _LOGW ("could not commit DNS changes: %s", error->message);
...@@ -1371,6 +1431,75 @@ nm_dns_manager_set_hostname (NMDnsManager *self, ...@@ -1371,6 +1431,75 @@ nm_dns_manager_set_hostname (NMDnsManager *self,
} }
} }
gboolean
nm_dns_manager_add_connection_config (NMDnsManager *self,
const char *iface,
int ifindex,
NMSettingConnectionMdns mdns)
{
NMDnsConnectionConfigData *data;
NMDnsManagerPrivate *priv;
NMDnsPlugin *plugin;
guint i;
g_return_val_if_fail (NM_IS_DNS_MANAGER (self), FALSE);
g_return_val_if_fail (ifindex > 0, FALSE);
g_return_val_if_fail (iface != NULL && iface[0], FALSE);
g_return_val_if_fail (mdns != NM_SETTING_CONNECTION_MDNS_UNKNOWN, FALSE);
priv = NM_DNS_MANAGER_GET_PRIVATE (self);
plugin = priv->plugin;
for (i = 0; i < priv->connection_configs->len; i++) {
data = priv->connection_configs->pdata[i];
if (nm_streq (data->iface, iface)) {
if (data->mdns == mdns)
/* already there */
return FALSE;
else {
data->mdns = mdns;
return nm_dns_plugin_update_mdns (plugin,
ifindex,
mdns);
}
}
}
data = connection_config_data_new (mdns, iface, ifindex);
g_ptr_array_add (priv->connection_configs, data);
return nm_dns_plugin_update_mdns (plugin, ifindex, mdns);
}
void
nm_dns_manager_remove_connection_config (NMDnsManager *self,
const char *iface,
int ifindex)
{
NMDnsConnectionConfigData *data;
NMDnsManagerPrivate *priv;
NMDnsPlugin *plugin;
guint i;
g_return_if_fail (NM_IS_DNS_MANAGER (self));
g_return_if_fail (iface != NULL && iface[0]);
g_return_if_fail (ifindex > 0);
priv = NM_DNS_MANAGER_GET_PRIVATE (self);
plugin = priv->plugin;
for (i = 0; i < priv->connection_configs->len; i++) {
data = priv->connection_configs->pdata[i];
if (nm_streq (data->iface, iface)) {
nm_dns_plugin_update_mdns (plugin,
ifindex,
NM_SETTING_CONNECTION_MDNS_UNKNOWN);
g_ptr_array_remove_index_fast (priv->connection_configs, i);
return;
}
}
}
gboolean gboolean
nm_dns_manager_get_resolv_conf_explicit (NMDnsManager *self) nm_dns_manager_get_resolv_conf_explicit (NMDnsManager *self)
{ {
...@@ -1419,7 +1548,7 @@ nm_dns_manager_end_updates (NMDnsManager *self, const char *func) ...@@ -1419,7 +1548,7 @@ nm_dns_manager_end_updates (NMDnsManager *self, const char *func)
g_return_if_fail (priv->updates_queue > 0); g_return_if_fail (priv->updates_queue > 0);
if (priv->need_sort) { if (priv->need_sort) {
g_ptr_array_sort (priv->configs, ip_config_data_ptr_compare); g_ptr_array_sort (priv->ip_configs, ip_config_data_ptr_compare);
priv->need_sort = FALSE; priv->need_sort = FALSE;
} }
...@@ -1833,8 +1962,8 @@ _get_config_variant (NMDnsManager *self) ...@@ -1833,8 +1962,8 @@ _get_config_variant (NMDnsManager *self)
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}")); g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}"));
for (i = 0; i < priv->configs->len; i++) { for (i = 0; i < priv->ip_configs->len; i++) {
NMDnsIPConfigData *current = priv->configs->pdata[i]; NMDnsIPConfigData *current = priv->ip_configs->pdata[i];
const NMIPConfig *config = current->config; const NMIPConfig *config = current->config;
GVariantBuilder entry_builder; GVariantBuilder entry_builder;
GVariantBuilder strv_builder; GVariantBuilder strv_builder;
...@@ -1932,7 +2061,8 @@ nm_dns_manager_init (NMDnsManager *self) ...@@ -1932,7 +2061,8 @@ nm_dns_manager_init (NMDnsManager *self)
_LOGT ("creating..."); _LOGT ("creating...");
priv->config = g_object_ref (nm_config_get ()); priv->config = g_object_ref (nm_config_get ());
priv->configs = g_ptr_array_new_full (8, ip_config_data_destroy); priv->ip_configs = g_ptr_array_new_full (8, ip_config_data_destroy);
priv->connection_configs = g_ptr_array_new_full (8, connection_config_data_destroy);
/* Set the initial hash */ /* Set the initial hash */
compute_hash (self, NULL, NM_DNS_MANAGER_GET_PRIVATE (self)->hash); compute_hash (self, NULL, NM_DNS_MANAGER_GET_PRIVATE (self)->hash);
...@@ -1949,7 +2079,7 @@ dispose (GObject *object) ...@@ -1949,7 +2079,7 @@ dispose (GObject *object)
{ {
NMDnsManager *self = NM_DNS_MANAGER (object); NMDnsManager *self = NM_DNS_MANAGER (object);
NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self); NMDnsManagerPrivate *priv = NM_DNS_MANAGER_GET_PRIVATE (self);
NMDnsIPConfigData *data; NMDnsIPConfigData *ip_data;
guint i; guint i;
_LOGT ("disposing"); _LOGT ("disposing");
...@@ -1964,13 +2094,18 @@ dispose (GObject *object) ...@@ -1964,13 +2094,18 @@ dispose (GObject *object)
g_clear_object (&priv->config); g_clear_object (&priv->config);
} }
if (priv->configs) { if (priv->ip_configs) {
for (i = 0; i < priv->configs->len; i++) { for (i = 0; i < priv->ip_configs->len; i++) {
data = priv->configs->pdata[i]; ip_data = priv->ip_configs->pdata[i];
forget_data (self, data); forget_ip_data (self, ip_data);
} }
g_ptr_array_free (priv->configs, TRUE); g_ptr_array_free (priv->ip_configs, TRUE);
priv->configs = NULL; priv->ip_configs = NULL;
}
if (priv->connection_configs) {
g_ptr_array_free (priv->connection_configs, TRUE);
priv->connection_configs = NULL;
} }
nm_clear_g_source (&priv->plugin_ratelimit.timer); nm_clear_g_source (&priv->plugin_ratelimit.timer);
...@@ -2036,4 +2171,3 @@ nm_dns_manager_class_init (NMDnsManagerClass *klass) ...@@ -2036,4 +2171,3 @@ nm_dns_manager_class_init (NMDnsManagerClass *klass)
NMDBUS_TYPE_DNS_MANAGER_SKELETON, NMDBUS_TYPE_DNS_MANAGER_SKELETON,
NULL); NULL);
} }
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "nm-ip4-config.h" #include "nm-ip4-config.h"
#include "nm-ip6-config.h" #include "nm-ip6-config.h"
#include "nm-setting-connection.h"
typedef enum { typedef enum {
NM_DNS_IP_CONFIG_TYPE_DEFAULT = 0, NM_DNS_IP_CONFIG_TYPE_DEFAULT = 0,
...@@ -44,6 +45,12 @@ typedef struct { ...@@ -44,6 +45,12 @@ typedef struct {
char *iface; char *iface;
} NMDnsIPConfigData; } NMDnsIPConfigData;
typedef struct {
NMSettingConnectionMdns mdns;
char *iface;
int ifindex;
} NMDnsConnectionConfigData;
#define NM_TYPE_DNS_MANAGER (nm_dns_manager_get_type ()) #define NM_TYPE_DNS_MANAGER (nm_dns_manager_get_type ())
#define NM_DNS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_DNS_MANAGER, NMDnsManager)) #define NM_DNS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_DNS_MANAGER, NMDnsManager))
#define NM_DNS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_DNS_MANAGER, NMDnsManagerClass)) #define NM_DNS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_DNS_MANAGER, NMDnsManagerClass))
...@@ -82,6 +89,16 @@ void nm_dns_manager_set_initial_hostname (NMDnsManager *self, ...@@ -82,6 +89,16 @@ void nm_dns_manager_set_initial_hostname (NMDnsManager *self,
void nm_dns_manager_set_hostname (NMDnsManager *self, void nm_dns_manager_set_hostname (NMDnsManager *self,
const char *hostname, const char *hostname,
gboolean skip_update); gboolean skip_update);
gboolean nm_dns_manager_add_connection_config (NMDnsManager *self,
const char *iface,
int ifindex,
NMSettingConnectionMdns mdns);
void nm_dns_manager_remove_connection_config (NMDnsManager *self,
const char *iface,
int ifindex);
void nm_dns_manager_update_ifindex (NMDnsManager *self,
const char *ip_iface,
int new_ifindex);
/** /**
* NMDnsManagerResolvConfManager * NMDnsManagerResolvConfManager
......
...@@ -89,6 +89,18 @@ nm_dns_plugin_update (NMDnsPlugin *self, ...@@ -89,6 +89,18 @@ nm_dns_plugin_update (NMDnsPlugin *self,
hostname); hostname);
} }
gboolean
nm_dns_plugin_update_mdns (NMDnsPlugin *self,
int ifindex,
NMSettingConnectionMdns mdns)
{
g_return_val_if_fail (NM_DNS_PLUGIN_GET_CLASS (self)->update_mdns != NULL, FALSE);
return NM_DNS_PLUGIN_GET_CLASS (self)->update_mdns (self,
ifindex,
mdns);
}
static gboolean static gboolean
is_caching (NMDnsPlugin *self) is_caching (NMDnsPlugin *self)
{ {
......
...@@ -60,6 +60,11 @@ typedef struct { ...@@ -60,6 +60,11 @@ typedef struct {
*/ */
gboolean (*is_caching) (NMDnsPlugin *self); gboolean (*is_caching) (NMDnsPlugin *self);
/* Subclasses wishing to control interface mDNS status should override. */
gboolean (*update_mdns) (NMDnsPlugin *self,
int ifindex,
NMSettingConnectionMdns mdns);
/* Subclasses should override this and return their plugin name */ /* Subclasses should override this and return their plugin name */
const char *(*get_name) (NMDnsPlugin *self); const char *(*get_name) (NMDnsPlugin *self);
...@@ -84,6 +89,10 @@ gboolean nm_dns_plugin_update (NMDnsPlugin *self, ...@@ -84,6 +89,10 @@ gboolean nm_dns_plugin_update (NMDnsPlugin *self,
const NMGlobalDnsConfig *global_config, const NMGlobalDnsConfig *global_config,
const char *hostname); const char *hostname);
gboolean nm_dns_plugin_update_mdns (NMDnsPlugin *self,
int ifindex,
NMSettingConnectionMdns mdns);
void nm_dns_plugin_stop (NMDnsPlugin *self); void nm_dns_plugin_stop (NMDnsPlugin *self);
/* For subclasses/plugins */ /* For subclasses/plugins */
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "nm-ip6-config.h" #include "nm-ip6-config.h"
#include "nm-bus-manager.h" #include "nm-bus-manager.h"
#include "nm-manager.h" #include "nm-manager.h"
#include "nm-setting-connection.h"
#include "devices/nm-device.h" #include "devices/nm-device.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
...@@ -57,6 +58,7 @@ typedef struct { ...@@ -57,6 +58,7 @@ typedef struct {
GDBusProxy *resolve; GDBusProxy *resolve;
GCancellable *init_cancellable; GCancellable *init_cancellable;
GCancellable *update_cancellable; GCancellable *update_cancellable;
GCancellable *mdns_cancellable;
GQueue dns_updates; GQueue dns_updates;
GQueue domain_updates; GQueue domain_updates;
} NMDnsSystemdResolvedPrivate; } NMDnsSystemdResolvedPrivate;
...@@ -314,6 +316,45 @@ update (NMDnsPlugin *plugin, ...@@ -314,6 +316,45 @@ update (NMDnsPlugin *plugin,
return TRUE; return TRUE;
} }
static gboolean
update_mdns (NMDnsPlugin *plugin, int ifindex, NMSettingConnectionMdns mdns)
{
NMDnsSystemdResolved *self = NM_DNS_SYSTEMD_RESOLVED (plugin);
NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
char *value;
_LOGI ("update_mdns: %i/%d", ifindex, mdns);
nm_clear_g_cancellable (&priv->mdns_cancellable);
if (!priv->resolve)
return FALSE;
priv->mdns_cancellable = g_cancellable_new ();
switch (mdns) {
case NM_SETTING_CONNECTION_MDNS_YES:
value = "yes";
break;
case NM_SETTING_CONNECTION_MDNS_NO:
value = "no";
break;
case NM_SETTING_CONNECTION_MDNS_RESOLVE:
value = "resolve";
break;
default:
/* reset to system default */
value = "";
}
g_dbus_proxy_call (priv->resolve, "SetLinkMulticastDNS",
g_variant_new ("(is)", ifindex, value),
G_DBUS_CALL_FLAGS_NONE,
-1, priv->mdns_cancellable, call_done, self);
return TRUE;
}