From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Elise Lennion <elise.lennion@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] statement: Avoid rounding bytes in get_rate()
Date: Sun, 12 Feb 2017 14:56:17 +0100 [thread overview]
Message-ID: <20170212135617.GC19847@salvia> (raw)
In-Reply-To: <20170212124534.GA2981@lennorien.com>
On Sun, Feb 12, 2017 at 10:45:34AM -0200, Elise Lennion wrote:
> get_rate() is used to print quotas and limits and currently rounds the
> number of bytes:
>
> $ nft add quota filter https-quota 4000 kbytes
> $ nft list ruleset
> table ip filter {
> quota https-quota {
> 3 mbytes
> }
> }
>
> This may be a problem when loading your configuration after saving it
> with 'list ruleset'. With this patch the values are represented in a
> greater unit only when there is no rest in the conversion:
>
> $ nft add quota filter https-quota2 2048 kbytes
> $ nft list ruleset
> table ip filter {
> quota https-quota {
> 4000 kbytes
> }
>
> quota https-quota2 {
> 2 mbytes
> }
> }
also applied, thanks Elise.
prev parent reply other threads:[~2017-02-12 13:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 12:45 [PATCH nft] statement: Avoid rounding bytes in get_rate() Elise Lennion
2017-02-12 13:56 ` Pablo Neira Ayuso [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=20170212135617.GC19847@salvia \
--to=pablo@netfilter.org \
--cc=elise.lennion@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).