aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hansen Færøy <ahf@torproject.org>2024-10-16 12:35:57 +0000
committerAlexander Hansen Færøy <ahf@torproject.org>2024-10-16 12:35:57 +0000
commit605f30c4865d8d462e4fd80c4e164862e0573548 (patch)
treec623991687a8161e314b3a509446bdc784899337
parente699cfc697fd6ac572fab7493cd52aa7d9a71dd9 (diff)
parentb5d2ef2aeb361ae75a17321854ca78c2d7282250 (diff)
downloadtor-605f30c4865d8d462e4fd80c4e164862e0573548.tar.gz
tor-605f30c4865d8d462e4fd80c4e164862e0573548.zip
Merge branch 'tor-resolve-bugfix' into 'main'
Create socket with correct family as given by sockshost See merge request tpo/core/tor!836
-rw-r--r--changes/bug409824
-rw-r--r--src/tools/tor-resolve.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/changes/bug40982 b/changes/bug40982
new file mode 100644
index 0000000000..cb38ec5c71
--- /dev/null
+++ b/changes/bug40982
@@ -0,0 +1,4 @@
+ o Minor bugfixes (tor-resolve):
+ - Create socket with correct family as given by sockshost, fixes IPv6.
+ Fixes bug 40982; bugfix on 0.4.9.0-alpha.
+
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index ad52fdaa22..33e565dac4 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -385,7 +385,7 @@ do_resolve(const char *hostname,
tor_addr_make_unspec(result_addr);
*result_hostname = NULL;
- s = tor_open_socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
+ s = tor_open_socket(sockshost->family,SOCK_STREAM,IPPROTO_TCP);
if (s<0) {
log_sock_error("creating_socket", -1);
return -1;