radsecproxy-1.6.5.
[libradsec.git] / tcp.c
diff --git a/tcp.c b/tcp.c
index 797ec9e..6de39fc 100644 (file)
--- a/tcp.c
+++ b/tcp.c
@@ -78,7 +78,9 @@ static char **getlistenerargs() {
 
 void tcpsetsrcres() {
     if (!srcres)
-       srcres = resolvepassiveaddrinfo(protoopts ? protoopts->sourcearg : NULL, NULL, protodefs.socktype);
+       srcres =
+            resolvepassiveaddrinfo(protoopts ? protoopts->sourcearg : NULL,
+                                   AF_UNSPEC, NULL, protodefs.socktype);
 }
 
 int tcpconnect(struct server *server, struct timeval *when, int timeout, char *text) {
@@ -274,7 +276,7 @@ void tcpserverrd(struct client *client) {
 
     debug(DBG_DBG, "tcpserverrd: starting for %s", addr2string(client->addr));
 
-    if (pthread_create(&tcpserverwrth, NULL, tcpserverwr, (void *)client)) {
+    if (pthread_create(&tcpserverwrth, &pthread_attr, tcpserverwr, (void *)client)) {
        debug(DBG_ERR, "tcpserverrd: pthread_create failed");
        return;
     }
@@ -355,7 +357,7 @@ void *tcplistener(void *arg) {
            debug(DBG_WARN, "accept failed");
            continue;
        }
-       if (pthread_create(&tcpserverth, NULL, tcpservernew, (void *)&s)) {
+       if (pthread_create(&tcpserverth, &pthread_attr, tcpservernew, (void *)&s)) {
            debug(DBG_ERR, "tcplistener: pthread_create failed");
            shutdown(s, SHUT_RDWR);
            close(s);