summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-11 17:00:41 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-11 17:16:29 -0400
commit35d08e30d89e5882b708a2cc6cb728f5393b2528 (patch)
treee07630bfeb3d681c04e9290ae53288e9308de7f1 /src/or/connection_edge.h
parent4bac2233116f0d94fd6ad1e77acb0baceeaf2336 (diff)
downloadtor-35d08e30d89e5882b708a2cc6cb728f5393b2528.tar.gz
tor-35d08e30d89e5882b708a2cc6cb728f5393b2528.zip
An attempt at bug3940 and making AllowDotExit 0 work with MapAddress
This time, I follow grarpamp's suggestion and move the check for .exit+AllowDotExit 0 to the top of connection_ap_rewrite_and_attach, before any rewriting occurs. This way, .exit addresses are forbidden as they arrive from a socks connection or a DNSPort request, and not otherwise. It _is_ a little more complicated than that, though. We need to treat any .exit addresses whose source is TrackHostExits as meaning that we can retry without that exit. We also need to treat any .exit address that comes from an AutomapHostsOnResolve operation as user-provided (and thus forbidden if AllowDotExits==0), so that transitioning from AllowDotExits==1 to AllowDotExits==0 will actually turn off automapped .exit addresses.
Diffstat (limited to 'src/or/connection_edge.h')
-rw-r--r--src/or/connection_edge.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 47c9c45b1a..b69e476ede 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -74,7 +74,8 @@ void addressmap_clean(time_t now);
void addressmap_clear_configured(void);
void addressmap_clear_transient(void);
void addressmap_free_all(void);
-int addressmap_rewrite(char *address, size_t maxlen, time_t *expires_out);
+int addressmap_rewrite(char *address, size_t maxlen, time_t *expires_out,
+ addressmap_entry_source_t *exit_source_out);
int addressmap_have_mapping(const char *address, int update_timeout);
void addressmap_register(const char *address, char *new_address,
@@ -100,7 +101,7 @@ int connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn,
typedef enum hostname_type_t {
NORMAL_HOSTNAME, ONION_HOSTNAME, EXIT_HOSTNAME, BAD_HOSTNAME
} hostname_type_t;
-hostname_type_t parse_extended_hostname(char *address, int allowdotexit);
+hostname_type_t parse_extended_hostname(char *address);
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_PFVAR_H)
int get_pf_socket(void);