From: Kurt Zeilenga Date: Wed, 6 Sep 2000 19:03:33 +0000 (+0000) Subject: Minor IPv6 changes (ITS#716) suggested by Stig Venass X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2087 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d4a89d30f8af777e60c5925ea387ff63e1a7813e;p=openldap Minor IPv6 changes (ITS#716) suggested by Stig Venass --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index fb0b70f1e2..997a1ea1bb 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -277,6 +277,15 @@ static Listener * open_listener( const char* url ) ldap_free_urldesc( lud ); sai = res; do { + if ( (sai->ai_family != AF_INET) +# ifdef LDAP_PF_INET6 + && (sai->ai_family != AF_INET6) +# endif +# ifdef LDAP_PF_LOCAL + && (sai->ai_family != AF_LOCAL) +# endif + ) + continue; l.sl_sd = socket( sai->ai_family, sai->ai_socktype, sai->ai_protocol); if ( l.sl_sd == AC_SOCKET_INVALID ) { int err = sock_errno(); @@ -910,7 +919,7 @@ slapd_daemon_task( case AF_INET6: if ( IN6_IS_ADDR_V4MAPPED(&from.sa_in6_addr.sin6_addr) ) { peeraddr = inet_ntoa( *((struct in_addr *) - &from.sa_in6_addr.sin6_addr.s6_addr32[3]) ); + &from.sa_in6_addr.sin6_addr.s6_addr[12]) ); sprintf( peername, "IP=%s:%d", peeraddr != NULL ? peeraddr : "unknown", (unsigned) ntohs( from.sa_in6_addr.sin6_port ) );