All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Andreas Schultz <aschultz@tpip.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: per network namespace nfacct
Date: Thu, 6 Aug 2015 12:07:13 +0200	[thread overview]
Message-ID: <20150806100713.GA18520@salvia> (raw)
In-Reply-To: <1438789905-5716-1-git-send-email-aschultz@tpip.net>

On Wed, Aug 05, 2015 at 05:51:45PM +0200, Andreas Schultz wrote:
> @@ -478,34 +482,59 @@ int nfnl_acct_overquota(const struct sk_buff *skb, struct nf_acct *nfacct)
>  }
>  EXPORT_SYMBOL_GPL(nfnl_acct_overquota);
>  
> +static int __net_init nfnl_acct_net_init(struct net *net)
> +{
> +	INIT_LIST_HEAD(&net->nfnl_acct_list);
> +
> +        return 0;
   ^^^^^^^^

Minor comestic: Please, make sure we get indent as tabs of 8-chars long.

> +}
> +
> +static void __net_exit nfnl_acct_net_exit(struct net *net)
> +{
> +	struct nf_acct *cur, *tmp;
> +
> +	list_for_each_entry_safe(cur, tmp, &net->nfnl_acct_list, head) {
> +		list_del_rcu(&cur->head);
> +
> +		if (atomic_dec_and_test(&cur->refcnt))
> +			kfree_rcu(cur, rcu_head);
> +	}
> +}

You better use nfnl_acct_put() here, otherwise we leak a module
refcount.

Other than that, this looks fine with me. Please send a v2.

Thanks.

  reply	other threads:[~2015-08-06 10:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 15:51 [PATCH] netfilter: per network namespace nfacct Andreas Schultz
2015-08-06 10:07 ` Pablo Neira Ayuso [this message]
2015-08-06 10:56   ` Andreas Schultz
2015-08-06 13:42     ` Pablo Neira Ayuso
2015-08-06 13:44       ` Andreas Schultz
2015-08-07  9:45         ` 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=20150806100713.GA18520@salvia \
    --to=pablo@netfilter.org \
    --cc=aschultz@tpip.net \
    --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 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.