]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: distinguish Add/Replace action operations.
authorRoman Mashak <mrv@mojatatu.com>
Sun, 22 Jan 2017 13:55:33 +0000 (08:55 -0500)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 30 Jan 2017 04:26:44 +0000 (20:26 -0800)
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Phil Sutter <phil@nwl.cc>
tc/m_action.c

index bb19df8823b5f76662e02304aad5890c971cb5e0..05ef07e0ff6cbe7b10d9f6a9aa20f42bc3d2e70f 100644 (file)
@@ -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;