netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Alexey Perevalov <a.perevalov@samsung.com>
Cc: kyungmin.park@samsung.com, hs81.go@samsung.com,
	netfilter-devel@vger.kernel.org, alexey.perevalov@hotmail.com,
	mathieu.poirier@linaro.org
Subject: Re: [PATCH] reset nfacct counters
Date: Tue, 29 Jul 2014 00:03:19 +0200	[thread overview]
Message-ID: <20140728220319.GB4093@salvia> (raw)
In-Reply-To: <1406570272-3704-1-git-send-email-a.perevalov@samsung.com>

On Mon, Jul 28, 2014 at 09:57:50PM +0400, Alexey Perevalov wrote:
> Hello Pablo,
> I used you guidance on flags usage for separate counters reset.
> If no flags were specified we'll have old behaviour. I wanted to remove
> NFNL_MSG_ACCT_GET_CTRZERO and use combination of (NFACCT_F_RESET_COUNTERS |
> NFACCT_F_RESET_QUOTAS). But in this case I didn't find how to solve backward
> compatibility issue.

Just made a proposal to avoid adding these new flags.

> You proposed to allocate memory for filter entity to use it with
> netlink_dump_control, but netlink_dump_start is synchronous all the way,
> and stack variable could be used there. But I could be wrong here and
> there is a use case where netlink_dump_control's callback is calling from
> another thread.

You can't do that. The dumping happens per recvmsg() call in netlink,
if the number of nfacct objects is larger than one page
(NLMSG_GOODSIZE), the next call to recvmsg() will reference to an
invalid memory area. You really need to allocate this, which is a bit
overkill for just one u32 flags filter, but I guess we'll have more
selectors to filter out nfacct objects in the future.

> Due nfnetlink_acct header was modified, I think I need to send additional patches
> for nfacct and libnetfilter_acct git reposotories. I saw such practice,
> nfnetlink_acct.h duplicates in these repositories.
> 
> This patch was made for git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> repository, on top of 633594bb2d3890711a887897f2003f41735f0dfa commit.

That tree is fine in this case, there is no changes in nf-next that
can clash with this.

> Do you need a patch for nfacct command line tool to support following behaviour:
> nfacct list reset [counter|quota] ?

Yes please :-), it would be great so others in the community can
benefit from this new feature, it's just little extra work. Thanks.

  reply	other threads:[~2014-07-28 22:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  8:05 reset nfacct counters Alexey Perevalov
2014-07-25 16:01 ` Pablo Neira Ayuso
2014-07-25 16:39   ` Alexey Perevalov
2014-07-28 17:57   ` [PATCH] " Alexey Perevalov
2014-07-28 22:03     ` Pablo Neira Ayuso [this message]
2014-07-28 17:57   ` [PATCH] netfilter: nfnetlink_acct: use flag to reset counters Alexey Perevalov
2014-07-28 21:53     ` Pablo Neira Ayuso
2014-07-29 11:46       ` Alexey Perevalov
2014-07-29 16:32         ` Pablo Neira Ayuso
2014-07-29 21:00           ` Alexey Perevalov
2014-08-04 15:52           ` [PATCH] netfilter: nfnetlink_acct: add filter support to nfacct counter list/reset Alexey Perevalov
2014-08-04 15:52           ` Alexey Perevalov
2014-08-05 15:51             ` Pablo Neira Ayuso
2014-08-06 10:41               ` [PATCH v2] " Alexey Perevalov
2014-08-20 13:34                 ` Pablo Neira Ayuso
2014-08-20 18:03                   ` [[PATCH v3]] " Alexey Perevalov
2014-08-24 13:15                     ` Pablo Neira Ayuso
2014-08-26 19:15                       ` Alexey Perevalov
2014-08-26 19:38                         ` Pablo Neira Ayuso
2014-08-26 19:24                       ` Alexey Perevalov
2014-08-06 10:50               ` [PATCH] " Alexey Perevalov

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=20140728220319.GB4093@salvia \
    --to=pablo@netfilter.org \
    --cc=a.perevalov@samsung.com \
    --cc=alexey.perevalov@hotmail.com \
    --cc=hs81.go@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=mathieu.poirier@linaro.org \
    --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).