summaryrefslogtreecommitdiffstats
path: root/lib/data.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@netfilter.org>2020-09-21 10:21:39 +0200
committerJozsef Kadlecsik <kadlec@netfilter.org>2020-09-21 10:21:39 +0200
commitde340a7f1a9cf21931d94ea8814545c4b2d172b0 (patch)
tree0a69eaed9d425a233d4213e3cb3e129d5d25796f /lib/data.c
parentdfdbad53f9c5a7bc3f357b53f11a840c8fda3635 (diff)
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>
Diffstat (limited to 'lib/data.c')
-rw-r--r--lib/data.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/data.c b/lib/data.c
index f28d1d3..43b6f71 100644
--- a/lib/data.c
+++ b/lib/data.c
@@ -50,7 +50,7 @@ struct ipset_data {
char setname2[IPSET_MAXNAMELEN];
/* CREATE/LIST/SAVE */
struct {
- uint8_t probes;
+ uint8_t bucketsize;
uint8_t resize;
uint8_t netmask;
uint32_t hashsize;
@@ -301,8 +301,8 @@ ipset_data_set(struct ipset_data *data, enum ipset_opt opt, const void *value)
case IPSET_OPT_NETMASK:
data->create.netmask = *(const uint8_t *) value;
break;
- case IPSET_OPT_PROBES:
- data->create.probes = *(const uint8_t *) value;
+ case IPSET_OPT_BUCKETSIZE:
+ data->create.bucketsize = *(const uint8_t *) value;
break;
case IPSET_OPT_RESIZE:
data->create.resize = *(const uint8_t *) value;
@@ -508,8 +508,8 @@ ipset_data_get(const struct ipset_data *data, enum ipset_opt opt)
return &data->create.markmask;
case IPSET_OPT_NETMASK:
return &data->create.netmask;
- case IPSET_OPT_PROBES:
- return &data->create.probes;
+ case IPSET_OPT_BUCKETSIZE:
+ return &data->create.bucketsize;
case IPSET_OPT_RESIZE:
return &data->create.resize;
case IPSET_OPT_SIZE:
@@ -625,7 +625,7 @@ ipset_data_sizeof(enum ipset_opt opt, uint8_t family)
case IPSET_OPT_CIDR:
case IPSET_OPT_CIDR2:
case IPSET_OPT_NETMASK:
- case IPSET_OPT_PROBES:
+ case IPSET_OPT_BUCKETSIZE:
case IPSET_OPT_RESIZE:
case IPSET_OPT_PROTO:
return sizeof(uint8_t);