diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-06-19 09:58:17 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-06-19 09:58:17 +0200 |
commit | b18f328967a97671b1ed9f662375a2becb5e2631 (patch) | |
tree | 1a5884f5d70fda36ee26783b01bfe3b11035dbbd | |
parent | 203e48033ba34a175be96da08f54b6d06916820f (diff) | |
parent | f05d41d3586aeca12d88379f5b0dbd6f7b4e21d7 (diff) | |
download | NetworkManager-b18f328967a97671b1ed9f662375a2becb5e2631.tar.gz |
merge: activate slaves when master is activated (bgo #735052) (rh #1158529)
When a master connection is activated, check all its slaves and decide whether
they should be activated as well. This is done according to the
connection.autoconnect-slaves property.
https://bugzilla.gnome.org/show_bug.cgi?id=735052
https://bugzilla.redhat.com/show_bug.cgi?id=1158529
-rw-r--r-- | clients/cli/settings.c | 64 | ||||
-rw-r--r-- | libnm-core/nm-setting-connection.c | 59 | ||||
-rw-r--r-- | libnm-core/nm-setting-connection.h | 22 | ||||
-rw-r--r-- | libnm-core/tests/test-general.c | 1 | ||||
-rw-r--r-- | libnm/libnm.ver | 2 | ||||
-rw-r--r-- | man/NetworkManager.conf.xml.in | 4 | ||||
-rw-r--r-- | src/nm-manager.c | 124 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/reader.c | 2 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/writer.c | 16 |
9 files changed, 287 insertions, 7 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c index e0b4675af6..4492c6481b 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -57,9 +57,10 @@ NmcOutputField nmc_fields_setting_connection[] = { SETTING_FIELD (NM_SETTING_CONNECTION_ZONE, 10), /* 10 */ SETTING_FIELD (NM_SETTING_CONNECTION_MASTER, 20), /* 11 */ SETTING_FIELD (NM_SETTING_CONNECTION_SLAVE_TYPE, 20), /* 12 */ - SETTING_FIELD (NM_SETTING_CONNECTION_SECONDARIES, 40), /* 13 */ - SETTING_FIELD (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, 30), /* 14 */ - SETTING_FIELD (NM_SETTING_CONNECTION_METERED, 10), /* 15 */ + SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, 13), /* 13 */ + SETTING_FIELD (NM_SETTING_CONNECTION_SECONDARIES, 40), /* 14 */ + SETTING_FIELD (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, 30), /* 15 */ + SETTING_FIELD (NM_SETTING_CONNECTION_METERED, 10), /* 16 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_CONNECTION_ALL "name"","\ @@ -75,6 +76,7 @@ NmcOutputField nmc_fields_setting_connection[] = { NM_SETTING_CONNECTION_ZONE","\ NM_SETTING_CONNECTION_MASTER","\ NM_SETTING_CONNECTION_SLAVE_TYPE","\ + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES","\ NM_SETTING_CONNECTION_SECONDARIES","\ NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT","\ NM_SETTING_CONNECTION_METERED @@ -777,6 +779,24 @@ ip6_privacy_to_string (NMSettingIP6ConfigPrivacy ip6_privacy, NmcPropertyGetType } static char * +autoconnect_slaves_to_string (NMSettingConnectionAutoconnectSlaves autoconnect_slaves, + NmcPropertyGetType get_type) +{ + if (get_type == NMC_PROPERTY_GET_PARSABLE) + return g_strdup_printf ("%d", autoconnect_slaves); + + switch (autoconnect_slaves) { + case NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO: + return g_strdup_printf (_("%d (no)"), autoconnect_slaves); + case NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES: + return g_strdup_printf (_("%d (yes)"), autoconnect_slaves); + case NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT: + default: + return g_strdup_printf (_("%d (default)"), autoconnect_slaves); + } +} + +static char * secret_flags_to_string (guint32 flags, NmcPropertyGetType get_type) { GString *flag_str; @@ -1094,6 +1114,14 @@ nmc_property_connection_get_permissions (NMSetting *setting, NmcPropertyGetType DEFINE_GETTER (nmc_property_connection_get_zone, NM_SETTING_CONNECTION_ZONE) DEFINE_GETTER (nmc_property_connection_get_master, NM_SETTING_CONNECTION_MASTER) DEFINE_GETTER (nmc_property_connection_get_slave_type, NM_SETTING_CONNECTION_SLAVE_TYPE) + +static char * +nmc_property_connection_get_autoconnect_slaves (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingConnection *s_con = NM_SETTING_CONNECTION (setting); + return autoconnect_slaves_to_string (nm_setting_connection_get_autoconnect_slaves (s_con), get_type); +} + DEFINE_GETTER (nmc_property_connection_get_secondaries, NM_SETTING_CONNECTION_SECONDARIES) DEFINE_GETTER (nmc_property_connection_get_gateway_ping_timeout, NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT) @@ -2296,6 +2324,22 @@ nmc_property_set_bool (NMSetting *setting, const char *prop, const char *val, GE } static gboolean +nmc_property_set_trilean (NMSetting *setting, const char *prop, const char *val, GError **error) +{ + long int val_int; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (!nmc_string_to_int (val, TRUE, -1, 1, &val_int)) { + g_set_error (error, 1, 0, _("'%s' is not a valid value; use -1, 0 or 1"), val); + return FALSE; + } + + g_object_set (setting, prop, val_int, NULL); + return TRUE; +} + +static gboolean nmc_property_set_ssid (NMSetting *setting, const char *prop, const char *val, GError **error) { GBytes *ssid; @@ -5416,6 +5460,13 @@ nmc_properties_init (void) NULL, nmc_property_con_allowed_slave_type, NULL); + nmc_add_prop_funcs (GLUE (CONNECTION, AUTOCONNECT_SLAVES), + nmc_property_connection_get_autoconnect_slaves, + nmc_property_set_trilean, + NULL, + NULL, + NULL, + NULL); nmc_add_prop_funcs (GLUE (CONNECTION, SECONDARIES), nmc_property_connection_get_secondaries, nmc_property_connection_set_secondaries, @@ -6815,9 +6866,10 @@ setting_connection_details (NMSetting *setting, NmCli *nmc, const char *one_pro set_val_str (arr, 10, nmc_property_connection_get_zone (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 11, nmc_property_connection_get_master (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 12, nmc_property_connection_get_slave_type (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 13, nmc_property_connection_get_secondaries (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 14, nmc_property_connection_get_gateway_ping_timeout (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 15, nmc_property_connection_get_metered (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 13, nmc_property_connection_get_autoconnect_slaves (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 14, nmc_property_connection_get_secondaries (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 15, nmc_property_connection_get_gateway_ping_timeout (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 16, nmc_property_connection_get_metered (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c index 5812a0a442..3ab8873dcf 100644 --- a/libnm-core/nm-setting-connection.c +++ b/libnm-core/nm-setting-connection.c @@ -27,6 +27,7 @@ #include "nm-utils.h" #include "nm-utils-private.h" +#include "nm-core-enum-types.h" #include "nm-setting-connection.h" #include "nm-connection-private.h" #include "nm-setting-bond.h" @@ -66,6 +67,7 @@ typedef struct { char *type; char *master; char *slave_type; + NMSettingConnectionAutoconnectSlaves autoconnect_slaves; GSList *permissions; /* list of Permission structs */ gboolean autoconnect; gint autoconnect_priority; @@ -91,6 +93,7 @@ enum { PROP_ZONE, PROP_MASTER, PROP_SLAVE_TYPE, + PROP_AUTOCONNECT_SLAVES, PROP_SECONDARIES, PROP_GATEWAY_PING_TIMEOUT, PROP_METERED, @@ -605,6 +608,25 @@ nm_setting_connection_is_slave_type (NMSettingConnection *setting, } /** + * nm_setting_connection_get_autoconnect_slaves: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:autoconnect-slaves property of the connection. + * + * Returns: whether slaves of the connection should be activated together + * with the connection. + * + * Since: 1.2 + **/ +NMSettingConnectionAutoconnectSlaves +nm_setting_connection_get_autoconnect_slaves (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect_slaves; +} + +/** * nm_setting_connection_get_num_secondaries: * @setting: the #NMSettingConnection * @@ -1153,6 +1175,9 @@ set_property (GObject *object, guint prop_id, g_free (priv->slave_type); priv->slave_type = g_value_dup_string (value); break; + case PROP_AUTOCONNECT_SLAVES: + priv->autoconnect_slaves = g_value_get_enum (value); + break; case PROP_SECONDARIES: g_slist_free_full (priv->secondaries, g_free); priv->secondaries = _nm_utils_strv_to_slist (g_value_get_boxed (value)); @@ -1227,6 +1252,9 @@ get_property (GObject *object, guint prop_id, case PROP_SLAVE_TYPE: g_value_set_string (value, nm_setting_connection_get_slave_type (setting)); break; + case PROP_AUTOCONNECT_SLAVES: + g_value_set_enum (value, nm_setting_connection_get_autoconnect_slaves (setting)); + break; case PROP_SECONDARIES: g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->secondaries)); break; @@ -1561,6 +1589,37 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) G_PARAM_STATIC_STRINGS)); /** + * NMSettingConnection:autoconnect-slaves: + * + * Whether or not slaves of this connection should be automatically brought up + * when NetworkManager activates this connection. This only has a real effect + * for master connections. + * The permitted values are: 0: leave slave connections untouched, + * 1: activate all the slave connections with this connection, -1: default. + * If -1 (default) is set, global connection.autoconnect-slaves is read to + * determine the real value. If it is default as well, this fallbacks to 0. + * + * Since: 1.2 + **/ + /* ---ifcfg-rh--- + * property: autoconnect-slaves + * variable: AUTOCONNECT-SLAVES(+) + * default: missing variable means global default + * description: Whether slaves of this connection should be auto-connected + * when this connection is activated. + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_AUTOCONNECT_SLAVES, + g_param_spec_enum (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, "", "", + NM_TYPE_SETTING_CONNECTION_AUTOCONNECT_SLAVES, + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_FUZZY_IGNORE | + G_PARAM_STATIC_STRINGS)); + + /** * NMSettingConnection:secondaries: * * List of connection UUIDs that should be activated when the base diff --git a/libnm-core/nm-setting-connection.h b/libnm-core/nm-setting-connection.h index 1692fe2c53..0f502c955e 100644 --- a/libnm-core/nm-setting-connection.h +++ b/libnm-core/nm-setting-connection.h @@ -56,10 +56,30 @@ G_BEGIN_DECLS #define NM_SETTING_CONNECTION_ZONE "zone" #define NM_SETTING_CONNECTION_MASTER "master" #define NM_SETTING_CONNECTION_SLAVE_TYPE "slave-type" +#define NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES "autoconnect-slaves" #define NM_SETTING_CONNECTION_SECONDARIES "secondaries" #define NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT "gateway-ping-timeout" #define NM_SETTING_CONNECTION_METERED "metered" +/* Types for property values */ +/** + * NMSettingConnectionAutoconnectSlaves: + * @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT: default value + * @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO: slaves are not brought up when + * master is activated + * @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES: slaves are brought up when + * master is activated + * + * #NMSettingConnectionAutoconnectSlaves values indicate whether slave connections + * should be activated when master is activated. + */ +typedef enum { + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT = -1, + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO = 0, + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES = 1, +} NMSettingConnectionAutoconnectSlaves; + + /** * NMSettingConnection: * @@ -112,6 +132,8 @@ const char *nm_setting_connection_get_master (NMSettingConnection *set gboolean nm_setting_connection_is_slave_type (NMSettingConnection *setting, const char *type); const char *nm_setting_connection_get_slave_type (NMSettingConnection *setting); +NM_AVAILABLE_IN_1_2 +NMSettingConnectionAutoconnectSlaves nm_setting_connection_get_autoconnect_slaves (NMSettingConnection *setting); guint32 nm_setting_connection_get_num_secondaries (NMSettingConnection *setting); const char *nm_setting_connection_get_secondary (NMSettingConnection *setting, guint32 idx); diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index 670a0f3e97..24128862ba 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -1968,6 +1968,7 @@ test_connection_diff_a_only (void) { NM_SETTING_CONNECTION_ZONE, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_MASTER, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_SLAVE_TYPE, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_SECONDARIES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_METERED, NM_SETTING_DIFF_RESULT_IN_A }, diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 34890414c3..e8990c3e98 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -853,6 +853,8 @@ global: nm_metered_get_type; nm_setting_802_1x_check_cert_scheme; nm_setting_bridge_get_multicast_snooping; + nm_setting_connection_autoconnect_slaves_get_type; + nm_setting_connection_get_autoconnect_slaves; nm_setting_connection_get_metered; nm_setting_ip_config_add_dns_option; nm_setting_ip_config_clear_dns_options; diff --git a/man/NetworkManager.conf.xml.in b/man/NetworkManager.conf.xml.in index d323a4e5f2..800b0882f8 100644 --- a/man/NetworkManager.conf.xml.in +++ b/man/NetworkManager.conf.xml.in @@ -468,6 +468,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth <programlisting> [connection] ipv6.ip6-privacy=0 +connection.autoconnect-slaves=1 [connection-wifi-wlan0] match-device=interface-name:wlan0 @@ -534,6 +535,9 @@ ipv6.ip6-privacy=1 <varlistentry> <term><varname>ipv6.route-metric</varname></term> </varlistentry> + <varlistentry> + <term><varname>connection.autoconnect-slaves</varname></term> + </varlistentry> </variablelist> </para> </refsect1> diff --git a/src/nm-manager.c b/src/nm-manager.c index bf9e69a368..228b832945 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2392,6 +2392,127 @@ ensure_master_active_connection (NMManager *self, return NULL; } +/** + * find_slaves: + * @manager: #NMManager object + * @connection: the master #NMConnection to find slave connections for + * @device: the master #NMDevice for the @connection + * + * Given an #NMConnection, attempts to find its slaves. If @connection is not + * master, or has not any slaves, this will return %NULL. + * + * Returns: list of slave connections for given master @connection, or %NULL + **/ +static GSList * +find_slaves (NMManager *manager, + NMConnection *connection, + NMDevice *device) +{ + NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); + GSList *all_connections, *iter; + GSList *slaves = NULL; + NMSettingConnection *s_con; + const char *master; + + s_con = nm_connection_get_setting_connection (connection); + g_assert (s_con); + master = nm_setting_connection_get_master (s_con); + + if (master != NULL) + return NULL; /* connection is not master */ + + /* Search through all connections, not only inactive ones, because + * even if a slave was already active, it might be deactivated during + * master reactivation. + */ + all_connections = nm_settings_get_connections (priv->settings); + for (iter = all_connections; iter; iter = iter->next) { + NMConnection *master_connection = NULL; + NMDevice *master_device = NULL; + NMConnection *candidate = iter->data; + + find_master (manager, candidate, NULL, &master_connection, &master_device, NULL, NULL); + if ( (master_connection && master_connection == connection) + || (master_device && master_device == device)) { + slaves = g_slist_prepend (slaves, candidate); + } + } + g_slist_free (all_connections); + + return g_slist_reverse (slaves); +} + +static gboolean +should_connect_slaves (NMConnection *connection, NMDevice *device) +{ + NMSettingConnection *s_con; + NMSettingConnectionAutoconnectSlaves autoconnect_slaves; + gs_free char *value = NULL; + + s_con = nm_connection_get_setting_connection (connection); + g_assert (s_con); + + /* Check autoconnect-slaves property */ + autoconnect_slaves = nm_setting_connection_get_autoconnect_slaves (s_con); + if (autoconnect_slaves != NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT) + goto out; + + /* Check configuration default for autoconnect-slaves property */ + value = nm_config_data_get_connection_default (nm_config_get_data (nm_config_get ()), + "connection.autoconnect-slaves", device); + if (value) + autoconnect_slaves = _nm_utils_ascii_str_to_int64 (value, 10, 0, 1, -1); + +out: + if (autoconnect_slaves == NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO) + return FALSE; + if (autoconnect_slaves == NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES) + return TRUE; + return FALSE; +} + +static gboolean +autoconnect_slaves (NMManager *manager, + NMConnection *master_connection, + NMDevice *master_device, + NMAuthSubject *subject) +{ + GError *local_err = NULL; + gboolean ret = FALSE; + + if (should_connect_slaves (master_connection, master_device)) { + GSList *slaves, *iter; + + iter = slaves = find_slaves (manager, master_connection, master_device); + ret = slaves != NULL; + + while (iter) { + NMConnection *slave_connection = iter->data; + + iter = iter->next; + nm_log_dbg (LOGD_CORE, "will activate slave connection '%s' (%s) as a dependency for master '%s' (%s)", + nm_connection_get_id (slave_connection), + nm_connection_get_uuid (slave_connection), + nm_connection_get_id (master_connection), + nm_connection_get_uuid (master_connection)); + + /* Schedule slave activation */ + nm_manager_activate_connection (manager, + slave_connection, + NULL, + nm_manager_get_best_device_for_connection (manager, slave_connection), + subject, + &local_err); + if (local_err) { + nm_log_warn (LOGD_CORE, "Slave connection activation failed: %s", local_err->message); + g_error_free (local_err); + } + } + g_slist_free (slaves); + } + return ret; +} + static gboolean _internal_activate_vpn (NMManager *self, NMActiveConnection *active, GError **error) { @@ -2564,6 +2685,9 @@ _internal_activate_device (NMManager *self, NMActiveConnection *active, GError * nm_active_connection_get_path (master_ac)); } + /* Check slaves for master connection and possibly activate them */ + autoconnect_slaves (self, connection, device, nm_active_connection_get_subject (active)); + /* Disconnect the connection if connected or queued on another device */ existing = nm_manager_get_connection_device (self, connection); if (existing) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 2387be3fcd..9dcf5f3b59 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -177,6 +177,8 @@ make_connection_setting (const char *file, NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_MIN, NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_MAX, NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_DEFAULT), + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, + svTrueValue (ifcfg, "AUTOCONNECT_SLAVES", NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT), NULL); value = svGetValue (ifcfg, "USERS", FALSE); diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index df2308e405..c93d167936 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -1694,7 +1694,7 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg) { guint32 n, i; GString *str; - const char *master; + const char *master, *type; char *tmp; gint i_int; @@ -1711,6 +1711,20 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg) svSetValue (ifcfg, "AUTOCONNECT_PRIORITY", tmp, FALSE); g_free (tmp); + /* Only save the value for master connections */ + svSetValue (ifcfg, "AUTOCONNECT_SLAVES", NULL, FALSE); + type = nm_setting_connection_get_connection_type (s_con); + if ( !g_strcmp0 (type, NM_SETTING_BOND_SETTING_NAME) + || !g_strcmp0 (type, NM_SETTING_TEAM_SETTING_NAME) + || !g_strcmp0 (type, NM_SETTING_BRIDGE_SETTING_NAME)) { + NMSettingConnectionAutoconnectSlaves autoconnect_slaves; + autoconnect_slaves = nm_setting_connection_get_autoconnect_slaves (s_con); + svSetValue (ifcfg, "AUTOCONNECT_SLAVES", + autoconnect_slaves == NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES ? "yes" : + autoconnect_slaves == NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO ? "no" : NULL, + FALSE); + } + /* Permissions */ svSetValue (ifcfg, "USERS", NULL, FALSE); n = nm_setting_connection_get_num_permissions (s_con); |