summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-02 12:00:46 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-02 12:00:46 -0500
commit8b93cbc16d2ec0b64ce9d48482a2cf2164ed1199 (patch)
tree40d7733c4b18e83132a0cc3313037d2ef56874a9 /src/or/connection.c
parent70d39859d63344ac7cce4f69cb6a7ad510a8cc32 (diff)
parent3b6da3f90ccad60517f5b639d5340a7e6489be27 (diff)
downloadtor-8b93cbc16d2ec0b64ce9d48482a2cf2164ed1199.tar.gz
tor-8b93cbc16d2ec0b64ce9d48482a2cf2164ed1199.zip
Merge branch 'bug20716_026' into maint-0.2.9
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 49cb78e389..d30ec46357 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1594,16 +1594,19 @@ connection_handle_listener_read(connection_t *conn, int new_type)
/* remember the remote address */
tor_addr_copy(&newconn->addr, &addr);
- newconn->port = port;
- newconn->address = tor_addr_to_str_dup(&addr);
+ if (new_type == CONN_TYPE_AP && conn->socket_family == AF_UNIX) {
+ newconn->port = 0;
+ newconn->address = tor_strdup(conn->address);
+ } else {
+ newconn->port = port;
+ newconn->address = tor_addr_to_str_dup(&addr);
+ }
if (new_type == CONN_TYPE_AP && conn->socket_family != AF_UNIX) {
log_info(LD_NET, "New SOCKS connection opened from %s.",
fmt_and_decorate_addr(&addr));
}
if (new_type == CONN_TYPE_AP && conn->socket_family == AF_UNIX) {
- newconn->port = 0;
- newconn->address = tor_strdup(conn->address);
log_info(LD_NET, "New SOCKS AF_UNIX connection opened");
}
if (new_type == CONN_TYPE_CONTROL) {