summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-06-18 11:39:02 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-07-08 09:43:06 +0200
commit7c60895d1e195598c48299691cba1e6ce9c558be (patch)
treed0db566de02e1f299b780bce7b6d643810c14538
parent4599be093e97d032b0a888c7deeeb84343a9005b (diff)
downloadNetworkManager-7c60895d1e195598c48299691cba1e6ce9c558be.tar.gz
libnm-core: pass variant-attribute-spec for tc actions
-rw-r--r--libnm-core/nm-utils.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index 85f7b4a673..4127abb54d 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -2591,11 +2591,21 @@ _string_append_tc_action (GString *string, NMTCAction *action, GError **error)
{
const char *kind = nm_tc_action_get_kind (action);
gs_free char *str = NULL;
+ const NMVariantAttributeSpec *const *attrs;
+
+ if (nm_streq (kind, "simple"))
+ attrs = tc_action_simple_attribute_spec;
+ else if (nm_streq (kind, "mirred"))
+ attrs = tc_action_mirred_attribute_spec;
+ else
+ attrs = NULL;
+
g_string_append (string, kind);
- str = nm_utils_format_variant_attributes (_nm_tc_action_get_attributes (action),
- ' ', ' ');
+ str = _nm_utils_format_variant_attributes (_nm_tc_action_get_attributes (action),
+ attrs,
+ ' ', ' ');
if (str) {
g_string_append_c (string, ' ');
g_string_append (string, str);