diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-08-25 21:16:22 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-08-25 21:16:22 +0000 |
commit | fd36eb07889403524d3361d15b5d008c22695952 (patch) | |
tree | 0736cbdbf611faff3bcc65ed19113f70c52b4e49 /src/or | |
parent | 7739c5c49a3eb191b7c042ead52d7e9d28515672 (diff) | |
download | tor-fd36eb07889403524d3361d15b5d008c22695952.tar.gz tor-fd36eb07889403524d3361d15b5d008c22695952.zip |
r8576@Kushana: nickm | 2006-08-25 17:16:01 -0400
Fix bug 314: Instead of checking address_in_virtualrange, check addressmap_have_mapping(). This should be more accurate. [Rename to addressmap_have_mapping() from addressmap_already_mapped().]
svn:r8226
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/buffers.c | 4 | ||||
-rw-r--r-- | src/or/circuituse.c | 2 | ||||
-rw-r--r-- | src/or/connection_edge.c | 4 | ||||
-rw-r--r-- | src/or/or.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 20fa700a04..75ba23712f 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -995,7 +995,7 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, strlcpy(req->address,tmpbuf,sizeof(req->address)); req->port = ntohs(*(uint16_t*)(buf->cur+8)); buf_remove_from_front(buf, 10); - if (!address_is_in_virtual_range(req->address) && + if (!addressmap_have_mapping(req->address) && !have_warned_about_unsafe_socks) { log_warn(LD_APP, "Your application (using socks5 on port %d) is giving " @@ -1091,7 +1091,7 @@ fetch_from_buf_socks(buf_t *buf, socks_request_t *req, startaddr = NULL; if (socks4_prot != socks4a && - !address_is_in_virtual_range(tmpbuf) && + !addressmap_have_mapping(tmpbuf) && !have_warned_about_unsafe_socks) { log_warn(LD_APP, "Your application (using socks4 on port %d) is giving Tor " diff --git a/src/or/circuituse.c b/src/or/circuituse.c index ba819de4d3..e4faee31af 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -1069,7 +1069,7 @@ consider_recording_trackhost(edge_connection_t *conn, origin_circuit_t *circ) /* Search the addressmap for this conn's destination. */ /* If he's not in the address map.. */ if (!options->TrackHostExits || - addressmap_already_mapped(conn->socks_request->address)) + addressmap_have_mapping(conn->socks_request->address)) return; /* nothing to track, or already mapped */ SMARTLIST_FOREACH(options->TrackHostExits, const char *, cp, { diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 0131b066b9..4e5ee2fdd1 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -645,9 +645,9 @@ addressmap_rewrite(char *address, size_t maxlen) /** Return 1 if <b>address</b> is already registered, else return 0 */ int -addressmap_already_mapped(const char *address) +addressmap_have_mapping(const char *address) { - return strmap_get(addressmap, address) ? 1 : 0; + return strmap_get_lc(addressmap, address) ? 1 : 0; } /** Register a request to map <b>address</b> to <b>new_address</b>, diff --git a/src/or/or.h b/src/or/or.h index 44d8c851d4..79a9ebe363 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1913,7 +1913,7 @@ void addressmap_clear_configured(void); void addressmap_clear_transient(void); void addressmap_free_all(void); void addressmap_rewrite(char *address, size_t maxlen); -int addressmap_already_mapped(const char *address); +int addressmap_have_mapping(const char *address); void addressmap_register(const char *address, char *new_address, time_t expires); int parse_virtual_addr_network(const char *val, int validate_only, |