public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Roman Mashak <mrv@mojatatu•com>
To: David Ahern <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: Mon, 09 Apr 2018 13:57:29 -0400	[thread overview]
Message-ID: <85r2no1cvq.fsf@mojatatu.com> (raw)
In-Reply-To: <f38705ad-38d0-9e65-510c-c71095e5afd8@gmail.com> (David Ahern's message of "Sun, 8 Apr 2018 11:50:56 -0600")

David Ahern <dsahern@gmail•com> writes:

> 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

OK. I will send v2.

      reply	other threads:[~2018-04-09 17:57 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
2018-04-09 17:57   ` Roman Mashak [this message]

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=85r2no1cvq.fsf@mojatatu.com \
    --to=mrv@mojatatu$(echo .)com \
    --cc=dsahern@gmail$(echo .)com \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=kernel@mojatatu$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=xiyou.wangcong@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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