summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2013-10-21 16:27:23 +0200
committerJiří Klimeš <jklimes@redhat.com>2013-10-21 16:30:04 +0200
commit6a8fd3f46980572ba95847df0ab8d7be850a6efb (patch)
tree19638d3559198a0e22fd97852a89072e54776dbf
parent8e17fc2aa46d3c2f06c788ca092d117913688b74 (diff)
downloadNetworkManager-6a8fd3f46980572ba95847df0ab8d7be850a6efb.tar.gz
cli: properly initialize new team-slave connections in editor
-rw-r--r--cli/src/connections.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/src/connections.c b/cli/src/connections.c
index e08bee8930..7c69f37809 100644
--- a/cli/src/connections.c
+++ b/cli/src/connections.c
@@ -6427,19 +6427,19 @@ editor_init_new_connection (NmCli *nmc, NMConnection *connection)
g_assert (s_con);
con_type = nm_setting_connection_get_connection_type (s_con);
- // TODO: properly initialize connection according to its type,
- // use sensible defaults.
- // This function is still a stub.
+ /* Initialize new connection according to its type using sensible defaults. */
if (g_strcmp0 (con_type, "bond-slave") == 0)
slave_type = NM_SETTING_BOND_SETTING_NAME;
+ if (g_strcmp0 (con_type, "team-slave") == 0)
+ slave_type = NM_SETTING_TEAM_SETTING_NAME;
if (g_strcmp0 (con_type, "bridge-slave") == 0)
slave_type = NM_SETTING_BRIDGE_SETTING_NAME;
if (slave_type) {
const char *dev_ifname = get_ethernet_device_name (nmc);
- /* For bond/bridge slaves add 'wired' setting */
+ /* For bond/team/bridge slaves add 'wired' setting */
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
@@ -6448,8 +6448,7 @@ editor_init_new_connection (NmCli *nmc, NMConnection *connection)
NM_SETTING_CONNECTION_MASTER, dev_ifname ? dev_ifname : "eth0",
NM_SETTING_CONNECTION_SLAVE_TYPE, slave_type,
NULL);
- }
- else {
+ } else {
/* Add a "base" setting to the connection by default */
setting = nmc_setting_new_for_name (con_type);
if (!setting)