Retrieve reachable addresses only.
AI_ADDRCONFIG helps not to try to connect unreachable ipv6 address if user doesn't have ipv6 network stack.
This commit is contained in:
		
							parent
							
								
									42e3587fd5
								
							
						
					
					
						commit
						d3a27947fe
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -205,7 +205,7 @@ net_resolve (netstore * ns, char *hostname, int port, char **real_host) | ||||||
| 
 | 
 | ||||||
| 	memset (&hints, 0, sizeof (struct addrinfo)); | 	memset (&hints, 0, sizeof (struct addrinfo)); | ||||||
| 	hints.ai_family = PF_UNSPEC; /* support ipv6 and ipv4 */ | 	hints.ai_family = PF_UNSPEC; /* support ipv6 and ipv4 */ | ||||||
| 	hints.ai_flags = AI_CANONNAME; | 	hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG; | ||||||
| 	hints.ai_socktype = SOCK_STREAM; | 	hints.ai_socktype = SOCK_STREAM; | ||||||
| 
 | 
 | ||||||
| 	if (port == 0) | 	if (port == 0) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue