[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1485093333-18317-1-git-send-email-mrv@mojatatu.com>
Date: Sun, 22 Jan 2017 08:55:33 -0500
From: Roman Mashak <mrv@...atatu.com>
To: stephen@...workplumber.org
Cc: netdev@...r.kernel.org, Roman Mashak <mrv@...atatu.com>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: [PATCH iproute2 1/1] tc: distinguish Add/Replace action operations.
Signed-off-by: Roman Mashak <mrv@...atatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@...atatu.com>
---
tc/m_action.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tc/m_action.c b/tc/m_action.c
index bb19df8..05ef07e 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;
--
1.9.1
Powered by blists - more mailing lists