Listener **slap_listeners = NULL;
+#define SLAPD_LISTEN 10
+
static ber_socket_t wake_sds[2];
#ifdef NO_THREADS
tcp_close(s);
}
-static slap_free_listener_addresses(struct sockaddr **sal)
+static void slap_free_listener_addresses(struct sockaddr **sal)
{
struct sockaddr **sap;
/* host specifies a service in this case */
if (err = getaddrinfo(NULL, host, &hints, &res)) {
Debug( LDAP_DEBUG_ANY, "daemon: getaddrinfo failed: %s\n",
- gai_strerror(err), 0, 0);
+ AC_GAI_STRERROR(err), 0, 0);
return -1;
}
} else
*sap = NULL;
break;
}
- sap++;
+ if (*sap != NULL) {
+ (*sap)->sa_family = sai->ai_family;
+ sap++;
+ }
} while ((sai = sai->ai_next) != NULL);
freeaddrinfo(res);
if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID )
continue;
- if ( listen( slap_listeners[l]->sl_sd, 5 ) == -1 ) {
+ if ( listen( slap_listeners[l]->sl_sd, SLAPD_LISTEN ) == -1 ) {
int err = sock_errno();
Debug( LDAP_DEBUG_ANY,
"daemon: listen(%s, 5) failed errno=%d (%s)\n",
}
for ( l = 0; slap_listeners[l] != NULL; l++ ) {
- ber_int_t s;
+ ber_socket_t s;
socklen_t len = sizeof(from);
long id;
slap_ssf_t ssf = 0;
sizeof(from.sa_in6_addr.sin6_addr),
AF_INET6 );
else
-# endif LDAP_PF_INET6
+# endif /* LDAP_PF_INET6 */
hp = gethostbyaddr(
(char *) &(from.sa_in_addr.sin_addr),
sizeof(from.sa_in_addr.sin_addr),