From: Patrick McHardy <kaber@trash.net>
To: Tim Gardner <tim.gardner@canonical.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/3] netfilter: Expose connection tracking accounting toggles
Date: Thu, 24 Jun 2010 17:36:13 +0200 [thread overview]
Message-ID: <4C237B6D.5010904@trash.net> (raw)
In-Reply-To: <1277393257-15281-2-git-send-email-tim.gardner@canonical.com>
Tim Gardner wrote:
> nf_ct_acct_enabled() - Get CT accounting state.
> nf_ct_set_acct() - Enable/disable CT accountuing.
>
Thanks for taking care of this. Just one final comment:
> diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h
> index 03e218f..31f5cd3 100644
> --- a/include/net/netfilter/nf_conntrack_acct.h
> +++ b/include/net/netfilter/nf_conntrack_acct.h
> @@ -45,6 +45,18 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp)
> extern unsigned int
> seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir);
>
> +/* Check if connection tracking accounting is enabled */
> +static inline bool nf_ct_acct_enabled(const struct xt_mtchk_param *par)
>
From an API point of view its cleaner to have the caller just pass
in the net pointer. Accounting has no direct relationship to xtables.
It would also make sense to fold this patch into 2/3 since this is
where these functions are actually getting used.
> +{
> + return par->net->ct.sysctl_acct == 0 ? false : true;
> +}
> +
> +/* Enable/disable connection tracking accounting */
> +static inline void nf_ct_set_acct(const struct xt_mtchk_param *par, bool enable)
>
Same here.
> +{
> + par->net->ct.sysctl_acct = enable == true ? 1 : 0;
> +}
> +
> extern int nf_conntrack_acct_init(struct net *net);
> extern void nf_conntrack_acct_fini(struct net *net);
>
>
next prev parent reply other threads:[~2010-06-24 15:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 15:27 nf-next-2.6 pull request, Complete deprecation of CONFIG_NF_CT_ACCT (V3) Tim Gardner
2010-06-24 15:27 ` [PATCH 1/3] netfilter: Expose connection tracking accounting toggles Tim Gardner
2010-06-24 15:36 ` Patrick McHardy [this message]
2010-06-24 16:07 ` Tim Gardner
2010-06-24 17:14 ` Jan Engelhardt
2010-06-24 15:27 ` [PATCH 2/3] netfilter: xt_connbytes: Force CT accounting to be enabled Tim Gardner
2010-06-24 17:15 ` Jan Engelhardt
2010-06-24 18:49 ` Tim Gardner
2010-06-25 8:44 ` Patrick McHardy
2010-06-24 15:27 ` [PATCH 3/3] netfilter: Complete the deprecation of CONFIG_NF_CT_ACCT Tim Gardner
-- strict thread matches above, loose matches on Subject: below --
2010-06-22 16:44 [PATCH 0/3] nf-next-2.6 pull request, Complete deprecation of CONFIG_NF_CT_ACCT (V2) tim.gardner
2010-06-22 16:44 ` [PATCH 1/3] netfilter: Expose connection tracking accounting toggles tim.gardner
2010-06-23 6:05 ` Patrick McHardy
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=4C237B6D.5010904@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=tim.gardner@canonical.com \
/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).