netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Roman Mashak <mrv@mojatatu.com>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, jiri@resnulli.us
Subject: Re: [PATCH iproute2 1/1] tc: print index, refcnt & bindcnt for nat action
Date: Tue, 27 Mar 2018 09:05:54 -0700	[thread overview]
Message-ID: <20180327090554.44e7c9e2@xeon-e3> (raw)
In-Reply-To: <1521570107-30024-1-git-send-email-mrv@mojatatu.com>

On Tue, 20 Mar 2018 14:21:47 -0400
Roman Mashak <mrv@mojatatu.com> wrote:

> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> ---
>  tc/m_nat.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tc/m_nat.c b/tc/m_nat.c
> index 1e4ff51fe75a..f6e373957c1b 100644
> --- a/tc/m_nat.c
> +++ b/tc/m_nat.c
> @@ -169,6 +169,9 @@ print_nat(struct action_util *au, FILE * f, struct rtattr *arg)
>  		format_host_r(AF_INET, 4, &sel->new_addr, buf2, sizeof(buf2)));
>  	print_action_control(f, " ", sel->action, "");
>  
> +	fprintf(f, "\n\t index %u ref %d bind %d",
> +		sel->index, sel->refcnt, sel->bindcnt);
> +
>  	if (show_stats) {
>  		if (tb[TCA_NAT_TM]) {
>  			struct tcf_t *tm = RTA_DATA(tb[TCA_NAT_TM]);
> @@ -177,6 +180,8 @@ print_nat(struct action_util *au, FILE * f, struct rtattr *arg)
>  		}
>  	}
>  
> +	fprintf(f, "\n");
> +
>  	return 0;
>  }

Rather than printing newline all the time, you need to use _SL_ to keep the optional
oneline output format.

I.e
	fprintf(f, "%s\t index %u ref %d bind %d",
		_SL_, sel->index, sel->refcnt, sel->bindcnt);

  reply	other threads:[~2018-03-27 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 18:21 [PATCH iproute2 1/1] tc: print index, refcnt & bindcnt for nat action Roman Mashak
2018-03-27 16:05 ` Stephen Hemminger [this message]
2018-03-27 21:32   ` Roman Mashak
2018-03-27 22:06     ` Stephen Hemminger
2018-03-27 22:07     ` Stephen Hemminger

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=20180327090554.44e7c9e2@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).