netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Josue Alvarez <jalvarez@toulouse.viveris.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: nfacct: setting quotas does not seem to work.
Date: Thu, 18 Aug 2016 00:44:57 +0200	[thread overview]
Message-ID: <20160817224457.GA5647@salvia> (raw)
In-Reply-To: <59114b3a-5fff-4099-e2f7-d749be4e1511@toulouse.viveris.com>

On Thu, Aug 11, 2016 at 04:00:37PM +0200, Josue Alvarez wrote:
> Hi,
> 
> I tried to play a little bit with the quota features of the extended
> accounting infrastructure.
> However, it seemed that the quotas were not registered when creating the
> accounting objects.
> 
> Example :
> # nfacct add testquota packet 5
> # iptables -I OUTPUT -p icmp -m nfacct --nfacct-name testquota
> # nfacct get testquota
> { pkts = 00000000000000000000, bytes = 00000000000000000000 } = testquota;
> 
> When I ping the machine, I see the counters go above 5 packets, however I
> get no output when running :
> # nfacct monitor

I get this here:

{ pkts = 00000000000000000005, bytes = 00000000000000000420, quota =
00000000000000000005, mode = packet, overquota = yes } = testquota;

> After a little bit of investigation in the code of nfacct, I checked that
> the NFACCT_ATTR_FLAGS and NFACCT_ATTR_QUOTA attributes were set. (i managed
> to call _nfacct_cmd_add with flags=NFACCT_F_QUOTA_PKTS).
> 
> However, the kernel code in netfilter/net/nfnetlink_acct.c somehow did not
> "get" the flags : the execution didn't enter in the  "if (tb[NFACCT_FLAGS])
> { ... }" in nfnl_acct_new(). (checked that using printk).
> 
> Any idea how this could happen ?

Probably using an old kernel version with no quota support?

  reply	other threads:[~2016-08-17 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 14:00 nfacct: setting quotas does not seem to work Josue Alvarez
2016-08-17 22:44 ` Pablo Neira Ayuso [this message]
2016-08-18  7:34   ` Josue Alvarez
2016-08-18 14:54     ` Pablo Neira Ayuso

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=20160817224457.GA5647@salvia \
    --to=pablo@netfilter.org \
    --cc=jalvarez@toulouse.viveris.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).