diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 13:31:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 13:31:26 -0400 |
commit | 2878dad9dbc1e07f608fa3acddc76261e4d76648 (patch) | |
tree | ecd19de0cc6ea5863ab0939e7b6bd627071af111 /src/or/connection.c | |
parent | df98582851a92d514c04061a5e0ec762c17a0cfb (diff) | |
parent | 32d9d69350f7fac564f4f4a245c57edd2e5c309a (diff) | |
download | tor-2878dad9dbc1e07f608fa3acddc76261e4d76648.tar.gz tor-2878dad9dbc1e07f608fa3acddc76261e4d76648.zip |
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 2bb97cd68d..9680b08b56 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1301,12 +1301,15 @@ connection_listener_new(const struct sockaddr *listensockaddr, gotPort = usePort; } else { tor_addr_t addr2; - if (tor_addr_from_getsockname(&addr2, s)<0) { + struct sockaddr_storage ss; + socklen_t ss_len=sizeof(ss); + if (getsockname(s, (struct sockaddr*)&ss, &ss_len)<0) { log_warn(LD_NET, "getsockname() couldn't learn address for %s: %s", conn_type_to_string(type), tor_socket_strerror(tor_socket_errno(s))); gotPort = 0; } + tor_addr_from_sockaddr(&addr2, (struct sockaddr*)&ss, &gotPort); } #ifdef HAVE_SYS_UN_H /* |