diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2020-06-18 11:39:02 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2020-07-08 09:43:06 +0200 |
commit | 7c60895d1e195598c48299691cba1e6ce9c558be (patch) | |
tree | d0db566de02e1f299b780bce7b6d643810c14538 | |
parent | 4599be093e97d032b0a888c7deeeb84343a9005b (diff) | |
download | NetworkManager-7c60895d1e195598c48299691cba1e6ce9c558be.tar.gz |
libnm-core: pass variant-attribute-spec for tc actions
-rw-r--r-- | libnm-core/nm-utils.c | 14 |
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); |