File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -989,17 +989,16 @@ 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 ;
994992
995993 /*
996994 * Optionally display the network address with the hostname.
997995 * This is useful to distinguish between IPv4 and IPv6 connections.
998996 */
999997 if (conn -> pghostaddr != NULL )
1000998 strlcpy (host_addr , conn -> pghostaddr , NI_MAXHOST );
1001- else if (inet_net_ntop (conn -> addr_cur -> ai_family , & host_addr_struct -> sin_addr ,
1002- host_addr_struct -> sin_family == AF_INET ? 32 : 128 ,
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 ,
10031002 host_addr , sizeof (host_addr )) == NULL )
10041003 strcpy (host_addr , "???" );
10051004
You can’t perform that action at this time.
0 commit comments