diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2023-03-16 11:52:42 +0800 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2023-03-18 19:20:02 -0700 |
commit | 73d294dfe63f2fadd52faa39c0079b44bfbe24ed (patch) | |
tree | cbfa508d8ee092bad5d4c7df854ff5f628c88f3f | |
parent | 0012881f3499dc9eb9e48e607ea7dd00fbe4edc2 (diff) | |
download | iproute2-73d294dfe63f2fadd52faa39c0079b44bfbe24ed.tar.gz |
tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum
We can't use TCA_EXT_WARN_MSG directly in tc action as it's using different
enum with filter. Let's use a new TCA_ROOT_EXT_WARN_MSG for tc action
specifically.
Fixes: 6035995665b7 ("tc: add new attr TCA_EXT_WARN_MSG")
Reviewed-by: Andrea Claudi <aclaudi@redhat.com>
Reported-and-tested-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r-- | tc/m_action.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tc/m_action.c b/tc/m_action.c index 0400132ce..a446cabdb 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -586,7 +586,13 @@ int print_action(struct nlmsghdr *n, void *arg) open_json_object(NULL); tc_dump_action(fp, tb[TCA_ACT_TAB], tot_acts ? *tot_acts:0, false); - print_ext_msg(tb); + + if (tb[TCA_ROOT_EXT_WARN_MSG]) { + print_string(PRINT_ANY, "warn", "%s", + rta_getattr_str(tb[TCA_ROOT_EXT_WARN_MSG])); + print_nl(); + } + close_json_object(); return 0; |