diff options
author | Jozsef Kadlecsik <kadlec@netfilter.org> | 2020-10-29 18:39:48 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-10-31 13:54:42 +0300 |
commit | ccf0a4b7fc688561428290265e4effde41446668 (patch) | |
tree | ec0972501cdc0b4d899371c552b84c9a592d7840 /net/netfilter/ipset/ip_set_core.c | |
parent | a304ea7daf542b1e4a136be80bc973fc713e6ca6 (diff) | |
download | linux-ccf0a4b7fc688561428290265e4effde41446668.tar.xz |
netfilter: ipset: Add bucketsize parameter to all hash types
The parameter defines the upper limit in any hash bucket at adding new entries
from userspace - if the limit would be exceeded, ipset doubles the hash size
and rehashes. It means the set may consume more memory but gives faster
evaluation at matching in the set.
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/ipset/ip_set_core.c')
-rw-r--r-- | net/netfilter/ipset/ip_set_core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index e3c00dacec5c..e76bfca2d3ef 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c @@ -1109,6 +1109,8 @@ static int ip_set_create(struct net *net, struct sock *ctnl, ret = -IPSET_ERR_PROTOCOL; goto put_out; } + /* Set create flags depending on the type revision */ + set->flags |= set->type->create_flags[revision]; ret = set->type->create(net, set, tb, flags); if (ret != 0) |