From: Hangbin Liu Date: Thu, 16 Mar 2023 03:52:42 +0000 (+0800) Subject: tc: m_action: fix parsing of TCA_EXT_WARN_MSG by using different enum X-Git-Tag: v6.3.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73d294dfe63f2fadd52faa39c0079b44bfbe24ed;p=thirdparty%2Fiproute2.git 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 Reported-and-tested-by: Davide Caratti Signed-off-by: Hangbin Liu Signed-off-by: Stephen Hemminger --- 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;