netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mr Dash Four <mr.dash.four@googlemail.com>
To: Jan Engelhardt <jengelh@medozas.de>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [patch 2/4] ipset: make IPv4 and IPv6 address handling similar
Date: Tue, 18 Jan 2011 22:49:21 +0000	[thread overview]
Message-ID: <4D3618F1.2040409@googlemail.com> (raw)
In-Reply-To: <20110118214343.GA4845@mail.eitzenberger.org>


> You shouldn't use hash:ip with ranges for IPv4 too because the range
> members are added individually, which is less efficient both memory
> and performance wise, see:
>
>  $ ipset create foo hash:ip hashsize 64
>  $ ipset add foo 192.168.1.0/30
>  $ ipset list foo
>  Name: foo
>  Type: hash:ip
>  Header: family inet hashsize 64 maxelem 65536 
>  Size in memory: 628
>  References: 0
>  Members:
>  192.168.1.3
>  192.168.1.2
>  192.168.1.0
>  192.168.1.1
>   
I disagree!

If I need to add the 192.168.1.0/30 then I have to execute a loop (via a 
script) and add individual elements (i.e. ipset add foo 192.168.1.0, 
ipset add foo 192.168.1.1 etc).

By specifying ipset add foo 192.168.1.0/30 I do that in one go. Even 
though I am inclined to agree that storing individual elements may not 
be the best way memory/storage wise I think performance wise (i.e. when 
the actual matching is performed) it is better matching a single IP 
address than IP range.


  reply	other threads:[~2011-01-18 22:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18 14:21 [patch 0/4] Ipset fixes holger
2011-01-18 14:21 ` [patch 1/4] ipset: show correct line numbers in restore output holger
2011-01-18 20:15   ` Jozsef Kadlecsik
2011-01-18 14:21 ` [patch 2/4] ipset: make IPv4 and IPv6 address handling similar holger
2011-01-18 20:18   ` Jozsef Kadlecsik
2011-01-18 20:25     ` Jan Engelhardt
2011-01-18 20:37       ` Jozsef Kadlecsik
2011-01-18 20:39         ` Jan Engelhardt
2011-01-18 20:54           ` Jozsef Kadlecsik
2011-01-18 21:43           ` Holger Eitzenberger
2011-01-18 22:49             ` Mr Dash Four [this message]
2011-01-18 14:21 ` [patch 3/4] ipset: do session initialization once holger
2011-01-18 20:16   ` Jozsef Kadlecsik
2011-01-18 14:21 ` [patch 4/4] ipset: fix build with NDEBUG defined holger
2011-01-18 20:20   ` 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=4D3618F1.2040409@googlemail.com \
    --to=mr.dash.four@googlemail.com \
    --cc=jengelh@medozas.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netdev@vger.kernel.org \
    --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).