From: Roman Mashak Date: Wed, 16 Nov 2016 22:30:20 +0000 (-0500) Subject: tc: distinguish Add/Replace filter operations X-Git-Tag: v4.9.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98df0c81dac41bcd4ccad67ec6886dab25825be0;p=thirdparty%2Fiproute2.git tc: distinguish Add/Replace filter operations Signed-off-by: Roman Mashak Signed-off-by: Jamal Hadi Salim --- diff --git a/tc/tc_filter.c b/tc/tc_filter.c index 932677a05..ff8713b98 100644 --- a/tc/tc_filter.c +++ b/tc/tc_filter.c @@ -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));