File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -989,16 +989,18 @@ connectFailureMessage(PGconn *conn, int errorno)
989989 {
990990 char host_addr [NI_MAXHOST ];
991991 bool display_host_addr ;
992+ struct sockaddr_in * host_addr_struct = (struct sockaddr_in * )
993+ & conn -> raddr .addr ;
992994
993995 /*
994996 * Optionally display the network address with the hostname.
995997 * This is useful to distinguish between IPv4 and IPv6 connections.
996998 */
997999 if (conn -> pghostaddr != NULL )
9981000 strlcpy (host_addr , conn -> pghostaddr , NI_MAXHOST );
999- else if (inet_net_ntop (conn -> addr_cur -> ai_family ,
1000- & conn -> addr_cur -> ai_addr ,
1001- conn -> addr_cur -> ai_family == AF_INET ? 32 : 128 ,
1001+ else if (inet_net_ntop (host_addr_struct -> sin_family ,
1002+ & host_addr_struct -> sin_addr . s_addr ,
1003+ host_addr_struct -> sin_family == AF_INET ? 32 : 128 ,
10021004 host_addr , sizeof (host_addr )) == NULL )
10031005 strcpy (host_addr , "???" );
10041006
You can’t perform that action at this time.
0 commit comments