aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-12-25 03:42:38 +0000
committerNick Mathewson <nickm@torproject.org>2006-12-25 03:42:38 +0000
commit58ae3cd64831d64779afa4ef2291ad969059eb4b (patch)
treea32c32fd2b0d3fa264607c324491ed5bc96174ff /src/or/router.c
parent3ab84c5f48231e8df2b27df97a8f342e526b0220 (diff)
downloadtor-58ae3cd64831d64779afa4ef2291ad969059eb4b.tar
tor-58ae3cd64831d64779afa4ef2291ad969059eb4b.tar.gz
r11713@Kushana: nickm | 2006-12-24 22:42:08 -0500
Better handling of internal addresses wrt X-Your-Address-Is (never believe them; never provide them.) Also, report something useful for X-Your-Address-Is with one-hop tunneled connections. svn:r9191
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index b0a3c5fef..409dcf29b 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1034,7 +1034,14 @@ router_new_address_suggestion(const char *suggestion)
last_guessed_ip = cur; /* store it in case we need it later */
return;
}
+ if (is_internal_IP(addr, 0)) {
+ /* Don't believe anybody who says our IP is, say, 127.0.0.1. */
+ return;
+ }
+ /* Okay. We can't resolve our own address, and X-Your-Address-Is is giving
+ * us an answer different from what we had the last time we managed to
+ * resolve it. */
if (last_guessed_ip != addr) {
log_addr_has_changed(LOG_NOTICE, last_guessed_ip, addr);
server_has_changed_ip();