netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
To: Giuseppe Longo <giuseppelng@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] iptables-nftables: function nft_chain_zero_counters added.
Date: Mon, 17 Jun 2013 13:13:08 +0300	[thread overview]
Message-ID: <51BEE134.5010406@linux.intel.com> (raw)
In-Reply-To: <20130617092600.2814.15883.stgit@localhost>

Hi Giuseppe,

Minor comments below.

> +
> +		nlh = nft_chain_nlmsg_build_hdr(buf, NFT_MSG_NEWCHAIN, h->family,

This line seems to have more than 80 characters.

There is a script in linux kernel sources that might help you before 
sending any patches: scripts/checkpatch.pl
Run it against your patches, it will tell you about such style issues. 
At least at the beginning, at some point code style becomes a reflex.


> +						NLM_F_ACK, h->seq);
> +
> +		nft_chain_nlmsg_build_payload(nlh, c);
> +
> +		ret = mnl_talk(h, nlh, NULL, NULL);
> +		if (ret < 0)
> +			perror("mnl_talk:nft_chain_zero_counters");

I guess you don't want to continue looping after you found your chain. 
On success, make it break.

And on error your function should return the error code.


Tomasz

  parent reply	other threads:[~2013-06-17 10:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17  9:26 [PATCH v3 1/2] iptables-nftables: function nft_chain_zero_counters added Giuseppe Longo
2013-06-17  9:26 ` [PATCH v3 2/2] xtables: function zero_entries removed Giuseppe Longo
2013-06-17 10:13 ` Tomasz Bursztyka [this message]
2013-06-17 11:29   ` [PATCH v3 1/2] iptables-nftables: function nft_chain_zero_counters added Pablo Neira Ayuso
2013-06-17 12:22     ` Giuseppe Longo
2013-06-17 12:41       ` Tomasz Bursztyka
2013-06-17 13:17   ` Giuseppe Longo
2013-06-18  4:50     ` Tomasz Bursztyka

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=51BEE134.5010406@linux.intel.com \
    --to=tomasz.bursztyka@linux.intel.com \
    --cc=giuseppelng@gmail.com \
    --cc=netfilter-devel@vger.kernel.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).