diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 13:16:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 13:16:37 -0400 |
commit | 32d9d69350f7fac564f4f4a245c57edd2e5c309a (patch) | |
tree | 11505840707bbc61c25cc9bbc1bac6d1bf410fe6 /src | |
parent | d38e474950ab41ad3593dc94de9a240f02938679 (diff) | |
parent | dfdf32404cd93671646481f6f3c129591a6901d7 (diff) | |
download | tor-32d9d69350f7fac564f4f4a245c57edd2e5c309a.tar.gz tor-32d9d69350f7fac564f4f4a245c57edd2e5c309a.zip |
Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4
Diffstat (limited to 'src')
-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 5185b45b14..7283a81043 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1260,12 +1260,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 /* |