torsocks icon indicating copy to clipboard operation
torsocks copied to clipboard

Use struct sockaddr_storage

Open steelman opened this issue 4 years ago • 1 comments

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.

steelman avatar Jan 05 '21 22:01 steelman

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

petterreinholdtsen avatar Sep 30 '22 21:09 petterreinholdtsen