]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: distinguish Add/Replace filter operations
authorRoman Mashak <mrv@mojatatu.com>
Wed, 16 Nov 2016 22:30:20 +0000 (17:30 -0500)
committerStephen Hemminger <sthemmin@microsoft.com>
Tue, 29 Nov 2016 21:26:10 +0000 (13:26 -0800)
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
tc/tc_filter.c

index 932677a058821d25f6270598a9d3deefc2308643..ff8713b98e315ea6209fb3ab714a7b8fd5e81a8e 100644 (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));