netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: tim.gardner@canonical.com
Cc: netfilter-devel@vger.kernel.org, ole@ans.pl
Subject: Re: [PATCH 1/3] netfilter: Expose connection tracking accounting toggles
Date: Wed, 23 Jun 2010 08:05:39 +0200	[thread overview]
Message-ID: <4C21A433.4060906@trash.net> (raw)
In-Reply-To: <1277225075-30428-2-git-send-email-tim.gardner@canonical.com>

tim.gardner@canonical.com wrote:
> From: Tim Gardner <tim.gardner@canonical.com>
>
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  include/net/netfilter/nf_conntrack.h |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
> index e624dae..2326754 100644
> --- a/include/net/netfilter/nf_conntrack.h
> +++ b/include/net/netfilter/nf_conntrack.h
> @@ -232,6 +232,18 @@ static inline void nf_ct_refresh(struct nf_conn *ct,
>  	__nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0);
>  }
>  
> +/* Check if connection tracking accounting is enabled */
> +static inline bool nf_ct_acct_enabled(struct nf_conn *ct)
> +{
> +		return ct->ct_net->ct.sysctl_acct == 0 ? false : true;
> +}
> +
> +/* Enable/disable connection tracking accounting */
> +static inline void nf_ct_set_acct(struct nf_conn *ct, bool enable)
> +{
> +		ct->ct_net->ct.sysctl_acct = enable == true ? 1 : 0;
> +}
> +

This looks strangely indented, please use a single tab. You also need
to take care of the CONFIG_NET_NS=n case where the ct_net pointer is
#ifdef'ed out. I'd suggest to simply pass the net pointer from
xt_mtchk_param, which is available unconditionally.


  reply	other threads:[~2010-06-23  6:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-06-22 16:44 ` [PATCH 2/3] netfilter: xt_connbytes: Force CT tracking to be enabled tim.gardner
2010-06-22 16:49   ` Jan Engelhardt
2010-06-22 17:55     ` Tim Gardner
2010-06-22 17:02   ` Tim Gardner
2010-06-23  6:05   ` Patrick McHardy
2010-06-22 16:44 ` [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-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
2010-06-24 16:07     ` Tim Gardner
2010-06-24 17:14   ` Jan Engelhardt

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=4C21A433.4060906@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=ole@ans.pl \
    --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).