Commit be768509 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Work correctly if your nameserver is ::1

We had all the code in place to handle this right... except that we
were unconditionally opening a PF_INET socket instead of looking at
sa_family.  Ow.

Fixes bug 2574; not a bugfix on any particular version, since this
never worked before.
parent 8a36f212
Loading
Loading
Loading
Loading

changes/bug2574

0 → 100644
+2 −0
Original line number Diff line number Diff line
  o Minor features:
    - Allow nameserves with IPv6 address. Fixes bug 2574.
+1 −1
Original line number Diff line number Diff line
@@ -2320,7 +2320,7 @@ _evdns_nameserver_add_impl(const struct sockaddr *address,
	memset(ns, 0, sizeof(struct nameserver));
	ns->timeout_event_deleted = __LINE__;

	ns->socket = socket(PF_INET, SOCK_DGRAM, 0);
	ns->socket = socket(address->sa_family, SOCK_DGRAM, 0);
	if (ns->socket < 0) { err = 1; goto out1; }
#ifdef WIN32
	{