From: Roman Mashak Date: Sun, 22 Jan 2017 13:55:33 +0000 (-0500) Subject: tc: distinguish Add/Replace action operations. X-Git-Tag: v4.10.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31951c47e94337d26b79be2360df3c5a956aaa6a;p=thirdparty%2Fiproute2.git tc: distinguish Add/Replace action operations. Signed-off-by: Roman Mashak Signed-off-by: Jamal Hadi Salim Acked-by: Phil Sutter --- diff --git a/tc/m_action.c b/tc/m_action.c index bb19df882..05ef07e0f 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -365,12 +365,18 @@ int print_action(const struct sockaddr_nl *who, fprintf(fp, "Flushed table "); tab_flush = 1; } else { - fprintf(fp, "deleted action "); + fprintf(fp, "Deleted action "); } } - if (n->nlmsg_type == RTM_NEWACTION) - fprintf(fp, "Added action "); + if (n->nlmsg_type == RTM_NEWACTION) { + if ((n->nlmsg_flags & NLM_F_CREATE) && + !(n->nlmsg_flags & NLM_F_REPLACE)) { + fprintf(fp, "Added action "); + } else if (n->nlmsg_flags & NLM_F_REPLACE) { + fprintf(fp, "Replaced action "); + } + } tc_print_action(fp, tb[TCA_ACT_TAB]); return 0;