]> git.sur5r.net Git - openldap/commitdiff
Set peeraddr also for IPv6, fixes ITS#1918
authorStig Venaas <venaas@openldap.org>
Fri, 5 Jul 2002 20:29:15 +0000 (20:29 +0000)
committerStig Venaas <venaas@openldap.org>
Fri, 5 Jul 2002 20:29:15 +0000 (20:29 +0000)
servers/slapd/daemon.c

index 9d260fc240913315f6ed5ed18fe5ed1aceb42e3c..1a72f5b070348f87c04c9a8c7088d5cb68160901 100644 (file)
@@ -1515,10 +1515,12 @@ slapd_daemon_task(
                                         (unsigned) ntohs( from.sa_in6_addr.sin6_port ) );
                        } else {
                                char addr[INET6_ADDRSTRLEN];
+
+                               peeraddr = (char *) inet_ntop( AF_INET6,
+                                                     &from.sa_in6_addr.sin6_addr,
+                                                     addr, sizeof addr );
                                sprintf( peername, "IP=%s %d",
-                                        inet_ntop( AF_INET6,
-                                                   &from.sa_in6_addr.sin6_addr,
-                                                   addr, sizeof addr) ? addr : "unknown",
+                                        peeraddr != NULL ? peeraddr : "unknown",
                                         (unsigned) ntohs( from.sa_in6_addr.sin6_port ) );
                        }
                        break;