in the ssl library.
- Fix that ratelimit and ip-ratelimit are applied after reload of
changed config file.
+ - Resize ratelimit and ip-ratelimit caches if changed on reload.
16 July 2018: Wouter
- Fix qname minimisation NXDOMAIN validation lookup failures causing
infra_ip_ratelimit = cfg->ip_ratelimit;
maxmem = cfg->infra_cache_numhosts * (sizeof(struct infra_key)+
sizeof(struct infra_data)+INFRA_BYTES_NAME);
+ /* divide cachesize by slabs and multiply by slabs, because if the
+ * cachesize is not an even multiple of slabs, that is the resulting
+ * size of the slabhash */
if(maxmem != slabhash_get_size(infra->hosts) ||
- cfg->infra_cache_slabs != infra->hosts->size) {
+ cfg->infra_cache_slabs != infra->hosts->size ||
+ cfg->ratelimit_slabs != infra->domain_rates->size ||
+ cfg->ratelimit_size/cfg->ratelimit_slabs*cfg->ratelimit_slabs != slabhash_get_size(infra->domain_rates) ||
+ cfg->ip_ratelimit_slabs != infra->client_ip_rates->size ||
+ cfg->ip_ratelimit_size/cfg->ip_ratelimit_slabs*cfg->ip_ratelimit_slabs != slabhash_get_size(infra->client_ip_rates)) {
infra_delete(infra);
infra = infra_create(cfg);
} else {