tc: distinguish Add/Replace qdisc operations

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
This commit is contained in:
Roman Mashak 2017-10-26 17:30:08 -04:00 committed by Stephen Hemminger
parent 840d95d348
commit 274b63ae21
1 changed files with 10 additions and 0 deletions

View File

@ -231,6 +231,16 @@ int print_qdisc(const struct sockaddr_nl *who,
if (n->nlmsg_type == RTM_DELQDISC)
fprintf(fp, "deleted ");
if (n->nlmsg_type == RTM_NEWQDISC &&
(n->nlmsg_flags & NLM_F_CREATE) &&
(n->nlmsg_flags & NLM_F_REPLACE))
fprintf(fp, "replaced ");
if (n->nlmsg_type == RTM_NEWQDISC &&
(n->nlmsg_flags & NLM_F_CREATE) &&
(n->nlmsg_flags & NLM_F_EXCL))
fprintf(fp, "added ");
if (show_raw)
fprintf(fp, "qdisc %s %x:[%08x] ",
rta_getattr_str(tb[TCA_KIND]),