mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 07:10:23 +01:00
cli: fix addition of slave connection types
$ nmcli connection add type bond-slave ifname aoeu master aoeu
Error: bad connection type: 'bond-slave' not among [802-1x, adsl,
bluetooth, bond, bridge, bridge-port, cdma, connection, dcb, dummy,
generic, gsm, infiniband, ipv4, ipv6, ip-tunnel, macsec, macvlan,
802-11-olpc-mesh (olpc-mesh), ppp, pppoe, proxy, serial, team,
team-port, tun, user, vlan, vpn, vxlan, wimax, 802-3-ethernet
(ethernet), 802-11-wireless (wifi), 802-11-wireless-security
(wifi-sec)].
Fixes: d32817999c
This commit is contained in:
parent
8acb2b1151
commit
8b52e506a7
1 changed files with 8 additions and 8 deletions
|
|
@ -3703,14 +3703,6 @@ set_connection_type (NmCli *nmc, NMConnection *con, const OptionInfo *option, co
|
|||
GError *local = NULL;
|
||||
const gchar *master[] = { "master", NULL };
|
||||
|
||||
value = check_valid_name_toplevel (value, &local);
|
||||
if (!value) {
|
||||
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("Error: bad connection type: %s."), local->message);
|
||||
g_clear_error (&local);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (g_strcmp0 (value, "bond-slave") == 0) {
|
||||
value = NM_SETTING_WIRED_SETTING_NAME;
|
||||
if (!set_property (con, NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
|
|
@ -3735,6 +3727,14 @@ set_connection_type (NmCli *nmc, NMConnection *con, const OptionInfo *option, co
|
|||
return FALSE;
|
||||
}
|
||||
enable_options (NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_MASTER, master);
|
||||
} else {
|
||||
value = check_valid_name_toplevel (value, &local);
|
||||
if (!value) {
|
||||
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("Error: bad connection type: %s"), local->message);
|
||||
g_clear_error (&local);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* ifname is mandatory for all connection types except virtual ones (bond, team, bridge, vlan) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue