From: Stig Venaas Date: Fri, 5 Jul 2002 20:29:15 +0000 (+0000) Subject: Set peeraddr also for IPv6, fixes ITS#1918 X-Git-Tag: NO_SLAP_OP_BLOCKS~1387 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=62139b6ef3634529c6d1ff726c337e685ea38cf8;p=openldap Set peeraddr also for IPv6, fixes ITS#1918 --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 9d260fc240..1a72f5b070 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -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;