netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH 1/2] nft: Use verbose flag to toggle debug output
Date: Tue, 8 Feb 2022 10:57:44 +0100	[thread overview]
Message-ID: <YgI+mJBFuYwHysfe@orbyte.nwl.cc> (raw)
In-Reply-To: <YgFevUBNBFagWjMx@salvia>

On Mon, Feb 07, 2022 at 07:02:37PM +0100, Pablo Neira Ayuso wrote:
> On Fri, Jan 28, 2022 at 09:36:59PM +0100, Phil Sutter wrote:
[...]
> > -static void nft_chain_print_debug(struct nftnl_chain *c, struct nlmsghdr *nlh)
> > +static void nft_chain_print_debug(struct nft_handle *h,
> > +				  struct nftnl_chain *c, struct nlmsghdr *nlh)
> >  {
> > -#ifdef NLDEBUG
> > -	char tmp[1024];
> > -
> > -	nftnl_chain_snprintf(tmp, sizeof(tmp), c, 0, 0);
> > -	printf("DEBUG: chain: %s\n", tmp);
> > -	mnl_nlmsg_fprintf(stdout, nlh, nlh->nlmsg_len, sizeof(struct nfgenmsg));
> > -#endif
> > +	if (h->verbose > 1) {
> > +		nftnl_chain_fprintf(stdout, c, 0, 0);
> > +		fprintf(stdout, "\n");
> > +	}
> > +	if (h->verbose > 2)
> > +		mnl_nlmsg_fprintf(stdout, nlh, nlh->nlmsg_len,
> > +				  sizeof(struct nfgenmsg));
> 
> OK, so -v is netlink byte printing and -vv means print netlink message
> too. LGTM.

-v is "normal verbose output", -vv is also nftnl debug and -vvv is also
netlink message dump.

> I'd mention this in the commit description before applying.

Your comment is proof this needs better documentation! :D
Guess I'll describe the behaviour in iptables man page as well.

Thanks, Phil

      reply	other threads:[~2022-02-08 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 20:36 [iptables PATCH 1/2] nft: Use verbose flag to toggle debug output Phil Sutter
2022-01-28 20:37 ` [iptables PATCH 2/2] iptables-restore: Support for extra " Phil Sutter
2022-02-07 18:02 ` [iptables PATCH 1/2] nft: Use verbose flag to toggle " Pablo Neira Ayuso
2022-02-08  9:57   ` Phil Sutter [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=YgI+mJBFuYwHysfe@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /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).