From: Duncan Roe <duncan_roe@optusnet.com.au>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: nmalykh@bilim.com, rv@wallfire.org,
netfilter-devel@vger.kernel.org,
Harsha Sharma <harshasharmaiitr@gmail.com>
Subject: Re: [PATCH] extensions: libxt_hashlimit: Do not print default timeout and burst
Date: Wed, 27 Dec 2017 10:31:04 +1100 [thread overview]
Message-ID: <20171226233104.GA3368@dimstar.local.net> (raw)
In-Reply-To: <CANMOCy24sTwdjOJS3bM0jRQcN-5_8dFw+tvtaZ3Mzd7PRTm3Bg@mail.gmail.com>
On Tue, Dec 19, 2017 at 08:20:31PM +0530, Harsha Sharma wrote:
> On Tue, Dec 19, 2017 at 7:31 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Tue, Dec 19, 2017 at 05:57:16PM +0530, Harsha Sharma wrote:
> >> @@ -1340,7 +1345,9 @@ static int hashlimit_mt_xlate(struct xt_xlate *xl, const char *name,
> >> xt_xlate_add(xl, "flow table %s {", name);
> >> ret = hashlimit_mode_xlate(xl, cfg->mode, family,
> >> cfg->srcmask, cfg->dstmask);
> >> - xt_xlate_add(xl, " timeout %us limit rate", cfg->expire / 1000);
> >> + if (!XT_HASHLIMIT_BYTE_EXPIRE_DEFAULT)
> >> + xt_xlate_add(xl, " timeout %us", cfg->expire / 1000);
> >
> > Better print cfg->expire if only if the default timeout is set.
> >
> > if (cfg->expire != XT_HASHLIMIT_XLATE_DEFAULT_TIMEOUT)
> > ...
> >
> > Same thing for burst. Thanks.
>
> This would result into not printing the timeout 1s (default value)
> even if user specifies it.
> For e.g.
> iptables-translate -A INPUT -m tcp -p tcp --dport 80 -m hashlimit
> --hashlimit-above 200kb/s --hashlimit-mode srcip,dstport
> --hashlimit-name http2 --hashlimit-htable-expire 1000 -j DROP
> nft add rule ip filter INPUT tcp dport 80 flow table http2 { tcp dport
> . ip saddr limit rate over 200 kbytes/second} counter drop
>
> and the expected output is
> nft add rule ip filter INPUT tcp dport 80 flow table http2 { tcp dport
> . ip saddr timeout 1s limit rate over 200 kbytes/second} counter drop
> (This patch allows this.)
> I hope this makes sense and same for burst.
> Thanks a lot for the review.
>
Have to say I agree with Harsha on this. You need a logical flag to say whether
a timeout was encountered.
Once this goes through, I'll fix the wiki,
Cheers ... Duncan.
next prev parent reply other threads:[~2017-12-26 23:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 12:27 [PATCH] extensions: libxt_hashlimit: Do not print default timeout and burst Harsha Sharma
2017-12-19 14:01 ` Pablo Neira Ayuso
2017-12-19 14:50 ` Harsha Sharma
2017-12-26 23:31 ` Duncan Roe [this message]
2017-12-27 10:07 ` Duncan Roe
2017-12-27 11:13 ` Pablo Neira Ayuso
2017-12-27 21:38 ` Duncan Roe
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=20171226233104.GA3368@dimstar.local.net \
--to=duncan_roe@optusnet.com.au \
--cc=harshasharmaiitr@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=nmalykh@bilim.com \
--cc=pablo@netfilter.org \
--cc=rv@wallfire.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.