diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-12-25 03:42:38 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-12-25 03:42:38 +0000 |
commit | 58ae3cd64831d64779afa4ef2291ad969059eb4b (patch) | |
tree | a32c32fd2b0d3fa264607c324491ed5bc96174ff /src/or/router.c | |
parent | 3ab84c5f48231e8df2b27df97a8f342e526b0220 (diff) | |
download | tor-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.c | 7 |
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(); |