debug(DBG_DBG, "dtlsserverrd: starting for %s", addr2string(client->addr));
- if (pthread_create(&dtlsserverwrth, NULL, dtlsserverwr, (void *)client)) {
+ if (pthread_create(&dtlsserverwrth, &pthread_attr, dtlsserverwr, (void *)client)) {
debug(DBG_ERR, "dtlsserverrd: pthread_create failed");
return;
}
X509 *cert = NULL;
SSL_CTX *ctx = NULL;
uint8_t delay = 60;
+ struct tls *accepted_tls = NULL;
debug(DBG_DBG, "dtlsservernew: starting");
conf = find_clconf(handle, (struct sockaddr *)¶ms->addr, NULL);
cert = verifytlscert(ssl);
if (!cert)
goto exit;
+ accepted_tls = conf->tlsconf;
}
while (conf) {
- if (verifyconfcert(cert, conf)) {
+ if (accepted_tls == conf->tlsconf && verifyconfcert(cert, conf)) {
X509_free(cert);
client = addclient(conf, 1);
if (client) {
if (udp2bio(s, params->sesscache->rbios, cnt)) {
debug(DBG_DBG, "udpdtlsserverrd: got DTLS in UDP from %s", addr2string((struct sockaddr *)&from));
- if (!pthread_create(&dtlsserverth, NULL, dtlsservernew, (void *)params)) {
+ if (!pthread_create(&dtlsserverth, &pthread_attr, dtlsservernew, (void *)params)) {
pthread_detach(dtlsserverth);
cacheexpire(sessioncache, &lastexpiry);
continue;
}
if (client4_sock >= 0)
- if (pthread_create(&cl4th, NULL, udpdtlsclientrd, (void *)&client4_sock))
+ if (pthread_create(&cl4th, &pthread_attr, udpdtlsclientrd, (void *)&client4_sock))
debugx(1, DBG_ERR, "pthread_create failed");
if (client6_sock >= 0)
- if (pthread_create(&cl6th, NULL, udpdtlsclientrd, (void *)&client6_sock))
+ if (pthread_create(&cl6th, &pthread_attr, udpdtlsclientrd, (void *)&client6_sock))
debugx(1, DBG_ERR, "pthread_create failed");
}
#else