diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-23 17:42:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-23 17:42:38 -0400 |
commit | be76850995f337337dd94be66a9f03b35d8b1412 (patch) | |
tree | fd94252328226a0ffcff718e5b9bbeab6f4ba970 /src | |
parent | 8a36f2125137dc31a0771a8eeac0f2bb8c1343d0 (diff) | |
download | tor-be76850995f337337dd94be66a9f03b35d8b1412.tar tor-be76850995f337337dd94be66a9f03b35d8b1412.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/eventdns.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c index 2777f9098..adab22bba 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 { |