From d4a89d30f8af777e60c5925ea387ff63e1a7813e Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 6 Sep 2000 19:03:33 +0000 Subject: [PATCH] Minor IPv6 changes (ITS#716) suggested by Stig Venass --- servers/slapd/daemon.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ) ); -- 2.39.5