summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-09-09 19:36:51 +0000
committerRoger Dingledine <arma@torproject.org>2006-09-09 19:36:51 +0000
commite56dbb810f936d9737b7a3b48906dc9a8d333007 (patch)
tree9b4466d7bd3b19bc5f158785203ad0850c363491 /src/or/router.c
parent9af3175687686841f25cab2fe7e1ade0c66a1ff9 (diff)
downloadtor-e56dbb810f936d9737b7a3b48906dc9a8d333007.tar.gz
tor-e56dbb810f936d9737b7a3b48906dc9a8d333007.zip
start remembering X-Your-Address-Is hints even if you're
a client, so you can become a server more smoothly. svn:r8359
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 96334f8aff..0fb8cf2b73 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -970,6 +970,7 @@ router_new_address_suggestion(const char *suggestion)
{
uint32_t addr, cur;
struct in_addr in;
+ or_options_t *options = get_options();
/* first, learn what the IP address actually is */
if (!tor_inet_aton(suggestion, &in)) {
@@ -980,7 +981,8 @@ router_new_address_suggestion(const char *suggestion)
log_debug(LD_DIR, "Got X-Your-Address-Is: %s.", suggestion);
- if (resolve_my_address(LOG_INFO, get_options(), &cur, NULL) >= 0) {
+ if (!server_mode(options) ||
+ resolve_my_address(LOG_INFO, options, &cur, NULL) >= 0) {
/* We're all set -- we already know our address. Great. */
last_guessed_ip = cur; /* store it in case we need it later */
return;