From: Nick Mathewson Date: Mon, 23 May 2011 21:42:38 +0000 (-0400) Subject: Work correctly if your nameserver is ::1 X-Git-Tag: tor-0.2.2.28-beta~8^2~1^2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be76850995f337337dd94be66a9f03b35d8b1412;p=thirdparty%2Ftor.git 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. --- diff --git a/changes/bug2574 b/changes/bug2574 new file mode 100644 index 0000000000..32f4ae4a92 --- /dev/null +++ b/changes/bug2574 @@ -0,0 +1,2 @@ + o Minor features: + - Allow nameserves with IPv6 address. Fixes bug 2574. diff --git a/src/or/eventdns.c b/src/or/eventdns.c index 2777f90989..adab22bba6 100644 --- a/src/or/eventdns.c +++ b/src/or/eventdns.c @@ -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 {