|
@@ -1464,7 +1464,8 @@ static uint32_t last_guessed_ip = 0;
|
|
* If this address is different from the one we think we are now, and
|
|
* If this address is different from the one we think we are now, and
|
|
* if our computer doesn't actually know its IP address, then switch. */
|
|
* if our computer doesn't actually know its IP address, then switch. */
|
|
void
|
|
void
|
|
-router_new_address_suggestion(const char *suggestion)
|
|
|
|
|
|
+router_new_address_suggestion(const char *suggestion,
|
|
|
|
+ const dir_connection_t *d_conn)
|
|
{
|
|
{
|
|
uint32_t addr, cur = 0;
|
|
uint32_t addr, cur = 0;
|
|
struct in_addr in;
|
|
struct in_addr in;
|
|
@@ -1494,6 +1495,13 @@ router_new_address_suggestion(const char *suggestion)
|
|
/* Don't believe anybody who says our IP is, say, 127.0.0.1. */
|
|
/* Don't believe anybody who says our IP is, say, 127.0.0.1. */
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (addr == d_conn->_base.addr) {
|
|
|
|
+ /* Don't believe anybody who says our IP is their IP. */
|
|
|
|
+ log_notice(LD_DIR, "A directory server told us our IP is %s, but that "
|
|
|
|
+ "seems to be the IP of the directory server saying these "
|
|
|
|
+ "things. Ignoring.", suggestion);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
/* Okay. We can't resolve our own address, and X-Your-Address-Is is giving
|
|
/* 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
|
|
* us an answer different from what we had the last time we managed to
|