#979384 torsocks: accept() and listen() don't work for AF_INET6 even on localhost

Package:
torsocks
Source:
torsocks
Description:
use SOCKS-friendly applications with Tor
Submitter:
Łukasz Stelmach
Date:
2025-03-05 00:51:02 UTC
Severity:
normal
Tags:
#979384#5
Date:
2021-01-05 23:08:48 UTC
From:
To:
Dear Maintainer,

I was trying to forward a local TCP to a remote machine over a torified
ssh connection but I received the following messages

listen: Operation not permitted
listen [::1]:6331: Operation not permitted

There is a problem in the libtorsocks implementation of listen(),
accept() and accept4() functions. They use struct sockaddr to store
results of getsockname(2), but the structure is too small for IPv6
addresses and utils_sockaddr_is_localhost() is never true for AF_INET6
sockets.