commit dbed09b483170b76c531e219792060ecf0e96ca6 Author: David Goulet dgoulet@ev0ke.net Date: Thu Nov 7 20:16:51 2013 -0500
Fix: reject IPv6 socket creation
Since Tor does not yet handle IPv6 DNS resolution or traffic, simply reject any socket creation with AF_INET6 type.
Signed-off-by: David Goulet dgoulet@ev0ke.net --- src/lib/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/src/lib/socket.c b/src/lib/socket.c index 8a4c0d1..dcc0444 100644 --- a/src/lib/socket.c +++ b/src/lib/socket.c @@ -34,6 +34,12 @@ LIBC_SOCKET_RET_TYPE tsocks_socket(LIBC_SOCKET_SIG)
switch (__type) { case SOCK_STREAM: + if (__domain == AF_INET6) { + /* Tor does not handle IPv6 at the moment. Reject it. */ + ERR("Socket is IPv6. Tor does not handle AF_INET6 connection."); + errno = EINVAL; + return -1; + } break; default: if (__domain == AF_INET || __domain == AF_INET6) {
tor-commits@lists.torproject.org