]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Work correctly if your nameserver is ::1
authorNick Mathewson <nickm@torproject.org>
Mon, 23 May 2011 21:42:38 +0000 (17:42 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 23 May 2011 21:42:38 +0000 (17:42 -0400)
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.

changes/bug2574 [new file with mode: 0644]
src/or/eventdns.c

diff --git a/changes/bug2574 b/changes/bug2574
new file mode 100644 (file)
index 0000000..32f4ae4
--- /dev/null
@@ -0,0 +1,2 @@
+  o Minor features:
+    - Allow nameserves with IPv6 address. Fixes bug 2574.
index 2777f9098987db38863780c8ee4a5930f3e5e9ed..adab22bba62549097fdff604e7d6e2dba798d73c 100644 (file)
@@ -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
        {