netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver <oliver@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] netfilter: ipset: Add hash:net,net module to kernel.
Date: Thu, 19 Sep 2013 11:13:43 +0200	[thread overview]
Message-ID: <4983376.CzhlSNdZFQ@gentoovm> (raw)
In-Reply-To: <alpine.DEB.2.00.1309181913300.21599@blackhole.kfki.hu>

On Wednesday 18 September 2013 19:23:00 Jozsef Kadlecsik wrote:
> Hi Oliver,
> 
> Please check your patches with checkpatch.pl and fix all errors, warnings.
> 

Of course, sorry about that.

> On Tue, 17 Sep 2013, Oliver wrote:
<snip>
> > @@ -461,6 +462,9 @@ mtype_expire(struct ip_set *set, struct htype *h, u8
> > nets_length, size_t dsize)> 
> >  	struct mtype_elem *data;
> >  	u32 i;
> >  	int j;
> > 
> > +#if IPSET_NET_COUNT > 1
> > +	u8 k;
> > +#endif
> 
> Please get rid of all these #if .. [#else ...] #endif constructions,
> except in mtype_test_cidrs. The compiler optimizes away the for loop when
> IPSET_NET_COUNT == 1.

Yep, there's a couple of other places where I don't currently see a way around 
it, but anywhere that it doesn't pose a logical problem to existing types, 
I've removed it.

> > +	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
> > +		     !ip_set_optattr_netorder(tb, IPSET_ATTR_TIMEOUT) ||
> > +		     !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS) ||
> > +		     !ip_set_optattr_netorder(tb, IPSET_ATTR_PACKETS) ||
> > +		     !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES)))
> > +		return -IPSET_ERR_PROTOCOL;
> > +	if (unlikely(tb[IPSET_ATTR_IP_TO]))
> > +		return -IPSET_ERR_HASH_RANGE_UNSUPPORTED;
> 
> Check tb[IPSET_ATTR_IP2_TO] in the condition above too.

This is IPv6, I thought ranges weren't even legitimate here, also, if this is 
wrong, hash:net must be too... Or does IP2_TO not mean what I think it means?

Kind Regards,
Oliver

  reply	other threads:[~2013-09-19  9:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 12:26 [PATCH 0/2] Add new hash:net,net type to ipset Oliver
2013-09-17 12:26 ` [PATCH 1/2] netfilter: ipset: Add hash:net,net module to kernel Oliver
2013-09-18 17:23   ` Jozsef Kadlecsik
2013-09-19  9:13     ` Oliver [this message]
2013-09-19  9:30       ` Jozsef Kadlecsik
2013-09-19 15:00         ` Oliver
2013-09-19 18:58           ` Jozsef Kadlecsik
2013-09-20  7:10             ` Oliver
2013-09-17 12:26 ` [PATCH 2/2] ipset: Add userspace code to support hash:net,net kernel module Oliver
2013-09-18 17:26   ` Jozsef Kadlecsik

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=4983376.CzhlSNdZFQ@gentoovm \
    --to=oliver@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa \
    --cc=kadlec@blackhole.kfki.hu \
    --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 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).