From: David Ahern <dsahern@gmail.com>
To: Roman Mashak <mrv@mojatatu.com>, dsahern@gmail.com
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
kernel@mojatatu.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
jiri@resnulli.us
Subject: Re: [PATCH iproute2-next 1/1] tc: jsonify skbedit action
Date: Sun, 8 Apr 2018 11:50:56 -0600 [thread overview]
Message-ID: <f38705ad-38d0-9e65-510c-c71095e5afd8@gmail.com> (raw)
In-Reply-To: <1522783461-14269-1-git-send-email-mrv@mojatatu.com>
On 4/3/18 1:24 PM, Roman Mashak wrote:
> if (tb[TCA_SKBEDIT_PTYPE] != NULL) {
> - ptype = RTA_DATA(tb[TCA_SKBEDIT_PTYPE]);
> - if (*ptype == PACKET_HOST)
> - fprintf(f, " ptype host");
> - else if (*ptype == PACKET_BROADCAST)
> - fprintf(f, " ptype broadcast");
> - else if (*ptype == PACKET_MULTICAST)
> - fprintf(f, " ptype multicast");
> - else if (*ptype == PACKET_OTHERHOST)
> - fprintf(f, " ptype otherhost");
> + ptype = rta_getattr_u16(tb[TCA_SKBEDIT_PTYPE]);
> + if (ptype == PACKET_HOST)
> + print_string(PRINT_ANY, "ptype", " %s", "ptype host");
> + else if (ptype == PACKET_BROADCAST)
> + print_string(PRINT_ANY, "ptype", " %s",
> + "ptype broadcast");
> + else if (ptype == PACKET_MULTICAST)
> + print_string(PRINT_ANY, "ptype", " %s",
> + "ptype multicast");
> + else if (ptype == PACKET_OTHERHOST)
> + print_string(PRINT_ANY, "ptype", " %s",
> + "ptype otherhost");
Shouldn't that be:
print_string(PRINT_ANY, "ptype", "ptype %s", "otherhost");
And ditto for the other strings.
> else
> - fprintf(f, " ptype %d", *ptype);
> + print_uint(PRINT_ANY, "ptype", " %u", ptype);
And then this one needs 'ptype' before %u
next prev parent reply other threads:[~2018-04-08 17:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 19:24 [PATCH iproute2-next 1/1] tc: jsonify skbedit action Roman Mashak
2018-04-08 17:50 ` David Ahern [this message]
2018-04-09 17:57 ` Roman Mashak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f38705ad-38d0-9e65-510c-c71095e5afd8@gmail.com \
--to=dsahern@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=mrv@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox