Просмотр исходного кода

Do not perform a lookup for IPv4 addresses, if only listening on IPv6 sockets.

Carsten Bock 13 лет назад
Родитель
Сommit
e1b3961b16
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      resolve.h

+ 4 - 2
resolve.h

@@ -429,8 +429,10 @@ static inline struct hostent* _resolvehost(char* name)
 	}
 #endif
 #endif
-	/* ipv4 */
-	he=gethostbyname(name);
+	if (socket_types & SOCKET_T_IPV4) {
+		/* ipv4 */
+		he=gethostbyname(name);
+	}
 #ifdef USE_IPV6
 	if(he==0 && cfg_get(core, core_cfg, dns_try_ipv6)){
 #ifndef DNS_IP_HACK