diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-14 14:55:49 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-14 14:55:49 -0500 |
commit | 41e0f7146a0377fb67858433deb4d9f4d7e95327 (patch) | |
tree | 7c6c1a6c7c56b4e12e76b921c2eb8feacea2827d /src/or/router.c | |
parent | 47cfee781d104a23ed44318c0c763c9834c0b7b6 (diff) | |
parent | 178599f026d9c7575a2b790c7cb5ccfba7ba1635 (diff) | |
download | tor-41e0f7146a0377fb67858433deb4d9f4d7e95327.tar tor-41e0f7146a0377fb67858433deb4d9f4d7e95327.tar.gz |
Merge remote-tracking branch 'arma/bug1992'
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c index 4492ed271..7b1fdc0df 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1712,7 +1712,9 @@ static int router_guess_address_from_dir_headers(uint32_t *guess); int router_pick_published_address(const or_options_t *options, uint32_t *addr) { - if (resolve_my_address(LOG_INFO, options, addr, NULL, NULL) < 0) { + *addr = get_last_resolved_addr(); + if (!*addr && + resolve_my_address(LOG_INFO, options, addr, NULL, NULL) < 0) { log_info(LD_CONFIG, "Could not determine our address locally. " "Checking if directory headers provide any hints."); if (router_guess_address_from_dir_headers(addr) < 0) { @@ -2159,7 +2161,9 @@ router_new_address_suggestion(const char *suggestion, } /* XXXX ipv6 */ - if (resolve_my_address(LOG_INFO, options, &cur, NULL, NULL) >= 0) { + cur = get_last_resolved_addr(); + if (cur || + resolve_my_address(LOG_INFO, options, &cur, NULL, NULL) >= 0) { /* We're all set -- we already know our address. Great. */ tor_addr_from_ipv4h(&last_guessed_ip, cur); /* store it in case we need it later */ |