From 62139b6ef3634529c6d1ff726c337e685ea38cf8 Mon Sep 17 00:00:00 2001 From: Stig Venaas Date: Fri, 5 Jul 2002 20:29:15 +0000 Subject: [PATCH] Set peeraddr also for IPv6, fixes ITS#1918 --- servers/slapd/daemon.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.39.5