diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-11-26 18:36:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-11-26 18:36:51 +0000 |
commit | 68142b18cd0020df68378850258c38c28231c15b (patch) | |
tree | db45345c98c35773242c8ac23b2281c6277269aa /src | |
parent | 80cc941c2d27a4ab2f27c2e7b30544a2a9196b42 (diff) | |
download | tor-68142b18cd0020df68378850258c38c28231c15b.tar.gz tor-68142b18cd0020df68378850258c38c28231c15b.zip |
r9396@totoro: nickm | 2006-11-26 13:36:29 -0500
Fix router_new_address_suggestion() so it only changes last_guessed_ip() when it actually calls resolve_my_address(). (bug found by dev-girl)
svn:r8996
Diffstat (limited to 'src')
-rw-r--r-- | src/or/router.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/router.c b/src/or/router.c index 27f401bed6..8c686441cd 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1009,7 +1009,7 @@ static uint32_t last_guessed_ip = 0; void router_new_address_suggestion(const char *suggestion) { - uint32_t addr, cur; + uint32_t addr, cur = 0; struct in_addr in; or_options_t *options = get_options(); @@ -1022,8 +1022,10 @@ router_new_address_suggestion(const char *suggestion) log_debug(LD_DIR, "Got X-Your-Address-Is: %s.", suggestion); - if (!server_mode(options) || - resolve_my_address(LOG_INFO, options, &cur, NULL) >= 0) { + if (!server_mode(options)) + return; + + if (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; |