From 93944333c52050ab31d509fcee2333f2e166d945 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Fri, 14 Aug 2015 19:12:19 +0200 Subject: update unbound --- external/unbound/daemon/daemon.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'external/unbound/daemon/daemon.c') diff --git a/external/unbound/daemon/daemon.c b/external/unbound/daemon/daemon.c index 0cd37ae82..e763f724e 100644 --- a/external/unbound/daemon/daemon.c +++ b/external/unbound/daemon/daemon.c @@ -399,6 +399,12 @@ daemon_create_workers(struct daemon* daemon) verbose(VERB_ALGO, "total of %d outgoing ports available", numport); daemon->num = (daemon->cfg->num_threads?daemon->cfg->num_threads:1); + if(daemon->reuseport && (int)daemon->num < (int)daemon->num_ports) { + log_warn("cannot reduce num-threads to %d because so-reuseport " + "so continuing with %d threads.", (int)daemon->num, + (int)daemon->num_ports); + daemon->num = (int)daemon->num_ports; + } daemon->workers = (struct worker**)calloc((size_t)daemon->num, sizeof(struct worker*)); if(daemon->cfg->dnstap) { @@ -464,7 +470,7 @@ thread_start(void* arg) #endif #ifdef SO_REUSEPORT if(worker->daemon->cfg->so_reuseport) - port_num = worker->thread_num; + port_num = worker->thread_num % worker->daemon->num_ports; else port_num = 0; #endif -- cgit v1.2.3