mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 15:40:10 +01:00
cli: support removing multiple vlan ingress/egress priority mappings
$ nmcli connection add type vlan autoconnect no con-name v dev vlan.1 id 1
$ nmcli connection modify v +vlan.ingress-priority-map 1:2,2:3
$ nmcli connection modify v +vlan.ingress-priority-map 2:3,4:5
$ nmcli connection modify v -vlan.ingress-priority-map 1:2,4:5
Warning: only one mapping at a time is supported; taking the first one (1:2)
This commit is contained in:
parent
626aed64e7
commit
d3cfe20598
1 changed files with 6 additions and 8 deletions
|
|
@ -4166,19 +4166,17 @@ _remove_vlan_xgress_priority_map (const NMMetaEnvironment *environment,
|
|||
|
||||
if (value) {
|
||||
gs_strfreev char **prio_map = NULL;
|
||||
gsize i;
|
||||
|
||||
prio_map = _parse_vlan_priority_maps (value, map_type, TRUE, error);
|
||||
if (!prio_map)
|
||||
return FALSE;
|
||||
if (prio_map[1]) {
|
||||
_env_warn_fcn (environment, environment_user_data,
|
||||
NM_META_ENV_WARN_LEVEL_WARN,
|
||||
N_("only one mapping at a time is supported; taking the first one (%s)"),
|
||||
prio_map[0]);
|
||||
|
||||
for (i = 0; prio_map[i]; i++) {
|
||||
nm_setting_vlan_remove_priority_str_by_value (NM_SETTING_VLAN (setting),
|
||||
map_type,
|
||||
prio_map[i]);
|
||||
}
|
||||
nm_setting_vlan_remove_priority_str_by_value (NM_SETTING_VLAN (setting),
|
||||
map_type,
|
||||
prio_map[0]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue