Skip to content

Commit 88a0926

Browse files
committed
deps: ignore loopback interface in c-ares on Windows
1 parent 7f8019e commit 88a0926

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

deps/cares/src/lib/ares_sysconfig_win.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454

5555
#include "ares_inet_net_pton.h"
5656

57+
#ifndef IF_TYPE_SOFTWARE_LOOPBACK
58+
#define IF_TYPE_SOFTWARE_LOOPBACK 24
59+
#endif
60+
5761
#if defined(USE_WINSOCK)
5862

5963
# define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
@@ -368,6 +372,9 @@ static ares_bool_t get_DNS_Windows(char **outptr)
368372
if (ipaaEntry->OperStatus != IfOperStatusUp) {
369373
continue;
370374
}
375+
if (ipaaEntry->IfType == IF_TYPE_SOFTWARE_LOOPBACK) {
376+
continue;
377+
}
371378

372379
/* For each interface, find any associated DNS servers as IPv4 or IPv6
373380
* addresses. For each found address, find the best route to that DNS

0 commit comments

Comments
 (0)