torsocks
torsocks copied to clipboard
Use struct sockaddr_storage
Use struct sockaddr_storage instead of struct sockaddr in listen(), accept() and accept4(). struct sockaddr is to small to hold result of getsockname() for AF_INET6 sockets. Therefore, utils_sockaddr_is_localhost() can never be true for AF_INET6 sockets.
I ran into this problem too, and it took me quite a long time to figure out the workaround was to specify 127.0.0.1 instead of expecting the default 'localhost' to work