diff options
author | Roger Dingledine <arma@torproject.org> | 2008-09-30 08:45:40 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2008-09-30 08:45:40 +0000 |
commit | 49a250b208333e35a3b7f1a82eae2682909692dd (patch) | |
tree | 81528a6c4525cc047a8dfa651c54b0bd9f5b9824 | |
parent | 7247838a258d6dff4e3f4b65d88ac46d5921640c (diff) | |
download | tor-49a250b208333e35a3b7f1a82eae2682909692dd.tar.gz tor-49a250b208333e35a3b7f1a82eae2682909692dd.zip |
i *think* this is equivalent. somebody should check me on it though.
svn:r17009
-rw-r--r-- | src/or/directory.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 14c06b87fc..9dfc80942a 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -2622,26 +2622,9 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, { geoip_client_action_t act = is_v3 ? GEOIP_CLIENT_NETWORKSTATUS : GEOIP_CLIENT_NETWORKSTATUS_V2; - - if (tor_addr_family(&conn->_base.addr) == AF_INET) { - uint32_t addr = tor_addr_to_ipv4h(&conn->_base.addr); - - if (conn->_base.linked_conn) { - connection_t *c = conn->_base.linked_conn; - if (c->type == CONN_TYPE_EXIT) { - circuit_t *circ = TO_EDGE_CONN(c)->on_circuit; - if (! CIRCUIT_IS_ORIGIN(circ)) { - or_connection_t *orconn = TO_OR_CIRCUIT(circ)->p_conn; - if (tor_addr_family(&conn->_base.addr) == AF_INET) - addr = tor_addr_to_ipv4h(&orconn->_base.addr); - else - addr = 0; - } - } - } - if (addr) - geoip_note_client_seen(act, addr, time(NULL)); - } + struct in_addr in; + if (!tor_inet_aton((TO_CONN(conn))->address, &in)) + geoip_note_client_seen(act, ntohl(in.s_addr), time(NULL)); } #endif |