]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix tor_ersatz_socketpair on IPv6-only systems
authorKris Katterjohn <katterjohn@gmail.com>
Mon, 7 Jan 2019 23:28:21 +0000 (17:28 -0600)
committerKris Katterjohn <katterjohn@gmail.com>
Mon, 7 Jan 2019 23:28:21 +0000 (17:28 -0600)
In get_local_listener used by tor_ersatz_socketpair, the address
family used when binding the IPv6 socket was AF_INET instead of
AF_INET6.

Fixes bug 28995; bugfix on 0.3.5.1-alpha.

Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
changes/bug28995 [new file with mode: 0644]
src/lib/net/socketpair.c

diff --git a/changes/bug28995 b/changes/bug28995
new file mode 100644 (file)
index 0000000..f76b6a0
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfix (IPv6):
+    Fix tor_ersatz_socketpair on IPv6-only systems.  Previously,
+    the IPv6 socket was bound using an address family of AF_INET
+    instead of AF_INET6.  Fixes bug 28995; bugfix on 0.3.5.1-alpha.
+    Patch from Kris Katterjohn.
index 380338f15c34b4b26abc45b912474fc1fd01abac..6a21581d87908a3e978961f60ab65a183e52eb7c 100644 (file)
@@ -62,7 +62,7 @@ get_local_listener(int family, int type)
     len = sizeof(sin);
   } else {
     sa = (struct sockaddr *) &sin6;
-    sin6.sin6_family = AF_INET;
+    sin6.sin6_family = AF_INET6;
     sin6.sin6_addr.s6_addr[15] = 1;
     len = sizeof(sin6);
   }