summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-08-07 19:13:35 +0000
committerNick Mathewson <nickm@torproject.org>2008-08-07 19:13:35 +0000
commitd9601c65e0529c1f79e52ca3576cbc8f0a82f8f6 (patch)
tree7025b74af0ad9c3bfb8a0ce6953864787d150e6a /src/or/connection.c
parent635f3c8aeef717d03a86117dfa81944fb6788bca (diff)
downloadtor-d9601c65e0529c1f79e52ca3576cbc8f0a82f8f6.tar.gz
tor-d9601c65e0529c1f79e52ca3576cbc8f0a82f8f6.zip
r17666@tombo: nickm | 2008-08-07 15:12:30 -0400
Make tor_addr_from_sockaddr also give away the port in a useful format svn:r16458
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index cf00f90eed..8cb04b35c3 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1032,12 +1032,7 @@ connection_handle_listener_read(connection_t *conn, int new_type)
return 0;
}
- tor_addr_from_sockaddr(&addr, remote);
- if (remote->sa_family == AF_INET)
- port = ((struct sockaddr_in *)remote)->sin_port;
- else
- port = ((struct sockaddr_in6 *)remote)->sin6_port;
- port = ntohs(port);
+ tor_addr_from_sockaddr(&addr, remote, &port);
/* process entrance policies here, before we even create the connection */
if (new_type == CONN_TYPE_AP) {