summaryrefslogtreecommitdiff
path: root/src/nm-config.c
diff options
context:
space:
mode:
authorJames Henstridge <james.henstridge@canonical.com>2017-08-09 15:19:54 +0800
committerThomas Haller <thaller@redhat.com>2017-08-17 22:31:47 +0200
commit9a58ee0705a5db75ce763eb2b24aec3f2c2028cb (patch)
tree523aa0108a5c498eb70f0b1330fc78e700885e17 /src/nm-config.c
parentc0ac4a2fdd530998bb6fa28f85d6f80467295550 (diff)
downloadNetworkManager-9a58ee0705a5db75ce763eb2b24aec3f2c2028cb.tar.gz
config: add an API to disable connectivity check via internal config file.
https://bugzilla.gnome.org/show_bug.cgi?id=785117
Diffstat (limited to 'src/nm-config.c')
-rw-r--r--src/nm-config.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nm-config.c b/src/nm-config.c
index 608ef23e1f..3faea15772 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -1590,6 +1590,33 @@ done:
return TRUE;
}
+/*****************************************************************************/
+
+void nm_config_set_connectivity_check_enabled (NMConfig *self,
+ gboolean enabled)
+{
+ NMConfigPrivate *priv;
+ GKeyFile *keyfile;
+
+ g_return_if_fail (NM_IS_CONFIG (self));
+
+ priv = NM_CONFIG_GET_PRIVATE (self);
+ g_return_if_fail (priv->config_data);
+
+ keyfile = nm_config_data_clone_keyfile_intern (priv->config_data);
+
+ /* Remove existing groups */
+ g_key_file_remove_group (keyfile, NM_CONFIG_KEYFILE_GROUP_CONNECTIVITY, NULL);
+
+ if (!enabled) {
+ g_key_file_set_value (keyfile, NM_CONFIG_KEYFILE_GROUP_CONNECTIVITY,
+ "enabled", "false");
+ }
+
+ nm_config_set_values (self, keyfile, TRUE, FALSE);
+ g_key_file_unref (keyfile);
+}
+
/**
* nm_config_set_values:
* @self: the NMConfig instance