Re: [PATCH 0/2] ipset: forceadd support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01.02.2014 14:30, Josh Hunt wrote:
Forceadd is a property for hash set types and is passed in duration creation.
When sets with this property enabled are full each subsequent 'add' operation
will attempt to evict a random entry from the set. The implementation tries to
keep the overhead low by checking to see which bucket the new entry hashes to.
If that bucket has any entries it will evict the first one and add the new
entry.

Ex usage:
ipset create foo hash:ip forceadd

The intended usecase is for things like 'ban' lists where you may not be concerned
with possibly evicting something early, and more concerned with the size of
the hash itself.

For all who want to save time typing while testing, I've already implemented the forceadd support in the ipset-bash_completion code available here:


As it's set to enable the feature from ipset v6.21+, you need to either bump the ipset version, or just change line 886 in my code from:

 if ((ips_version[0] == 6 && ips_version[1] >= 21)); then

to:

 if ((ips_version[0] == 6 && ips_version[1] >= 20)); then

happy testing :)



--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux