From 58ae3cd64831d64779afa4ef2291ad969059eb4b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 25 Dec 2006 03:42:38 +0000 Subject: 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 --- src/or/router.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/or/router.c') 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(); -- cgit v1.2.3