All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Yi-Hung Wei <yihung.wei@gmail.com>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next v2] netfilter: connlimit: split xt_connlimit into front/backend
Date: Wed, 6 Dec 2017 08:34:26 +0100	[thread overview]
Message-ID: <20171206073426.GA29475@breakpoint.cc> (raw)
In-Reply-To: <CAG1aQhJFE3BLkUcOx+Eb2FiCz5xH5Ui8Q5RmnRw5Q6+rePk=Uw@mail.gmail.com>

Yi-Hung Wei <yihung.wei@gmail.com> wrote:
> Thanks for working on this patch.
> 
> > --- /dev/null
> > +++ b/include/net/netfilter/nf_conntrack_count.h
> > @@ -0,0 +1,13 @@
> Should it have something like the following in the header file?
> 
> #ifdef _NF_CONNTRACK_COUNT_H
> #define _NF_CONNTRACK_COUNT_H

I can add it, sure.

> > --- /dev/null
> > +++ b/net/netfilter/nf_conncount.c
> > +
> > +struct nf_conncount_data *nf_conncount_init(struct net *net, unsigned int family,
> > +                                           unsigned int keylen)
> > +{
> > +       struct nf_conncount_data *data;
> > +       int ret, i;
> > +
> > +       if (keylen % sizeof(u32) ||
> > +           keylen / sizeof(u32) > MAX_KEYLEN ||
> > +           keylen == 0)
> > +               return ERR_PTR(-EINVAL);
> Just wanna to check the case that if users want to count only by zone,
> since zone id is only 2 bytes, the user should claim 4 bytes as the
> keylen right?

Yes, I used jhash2 internally which requires input in u32-sized chunks.

> > +       ret = nf_ct_netns_get(net, family);
> > +       if (ret < 0)
> > +               return ERR_PTR(ret);
> > +
> > +       data = kmalloc(sizeof(*data), GFP_KERNEL);
> > +       if (!data)
> > +               return ERR_PTR(-ENOMEM);
> Should we call nf_ct_netns_put() in the error case?

Indeed, I'll fix this, thanks for the review!

      reply	other threads:[~2017-12-06  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02  9:49 [PATCH nf-next v2] netfilter: connlimit: split xt_connlimit into front/backend Florian Westphal
2017-12-06  0:55 ` Yi-Hung Wei
2017-12-06  7:34   ` Florian Westphal [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=20171206073426.GA29475@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=yihung.wei@gmail.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 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.