+
+
+ /* Learn the actual network identity of the host to which we are connected */
+
+ struct sockaddr_in6 clientaddr;
+ unsigned int addrlen = sizeof(clientaddr);
+
+ ipc->ip_hostname[0] = 0;
+ ipc->ip_address[0] = 0;
+
+ getpeername(ipc->sock, (struct sockaddr *)&clientaddr, &addrlen);
+ getnameinfo((struct sockaddr *)&clientaddr, addrlen,
+ ipc->ip_hostname, sizeof ipc->ip_hostname, NULL, 0, 0
+ );
+ getnameinfo((struct sockaddr *)&clientaddr, addrlen,
+ ipc->ip_address, sizeof ipc->ip_address, NULL, 0, NI_NUMERICHOST
+ );
+
+ /* stuff other things elsewhere */
+