libnm-core: pass variant-attribute-spec for tc actions

This commit is contained in:
Beniamino Galvani 2020-06-18 11:39:02 +02:00
parent 4599be093e
commit 7c60895d1e

View file

@ -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);