]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 16 Mar 2023 03:52:42 +0000 (11:52 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 19 Mar 2023 02:20:02 +0000 (19:20 -0700)
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>
tc/m_action.c

index 0400132ceff63480003b18ed52699d3b8d83d18a..a446cabdb98ca5cc8879257cecf1fe7033d0fda7 100644 (file)
@@ -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;