tc: distinguish Add/Replace filter operations

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
This commit is contained in:
Roman Mashak 2016-11-16 17:30:20 -05:00 committed by Stephen Hemminger
parent 3a4df03913
commit 98df0c81da
1 changed files with 10 additions and 0 deletions

View File

@ -226,6 +226,16 @@ int print_filter(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if (n->nlmsg_type == RTM_DELTFILTER)
fprintf(fp, "deleted ");
if (n->nlmsg_type == RTM_NEWTFILTER &&
(n->nlmsg_flags & NLM_F_CREATE) &&
!(n->nlmsg_flags & NLM_F_EXCL))
fprintf(fp, "replaced ");
if (n->nlmsg_type == RTM_NEWTFILTER &&
(n->nlmsg_flags & NLM_F_CREATE) &&
(n->nlmsg_flags & NLM_F_EXCL))
fprintf(fp, "added ");
fprintf(fp, "filter ");
if (!filter_ifindex || filter_ifindex != t->tcm_ifindex)
fprintf(fp, "dev %s ", ll_index_to_name(t->tcm_ifindex));