aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-07-17 19:33:54 +0000
committerRoger Dingledine <arma@torproject.org>2006-07-17 19:33:54 +0000
commitc85745cfe288adebccd02b0c4b9b2c4e813d33ec (patch)
treebb4005a77663efe552a1264a1f8136807e5a81b5 /src/or/router.c
parent542adb88d7eecf8691d2118ad1fe96dc9c9bacd7 (diff)
downloadtor-c85745cfe288adebccd02b0c4b9b2c4e813d33ec.tar.gz
tor-c85745cfe288adebccd02b0c4b9b2c4e813d33ec.zip
parameterize the loudness of log_addr_has_changed(), since it's the
only place where we inform the user of a new IP address, if we're guessing it from external sources. svn:r6780
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/router.c b/src/or/router.c
index fc827f8954..40f994f6a5 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -897,7 +897,7 @@ check_descriptor_bandwidth_changed(time_t now)
}
static void
-log_addr_has_changed(uint32_t prev, uint32_t cur)
+log_addr_has_changed(int severity, uint32_t prev, uint32_t cur)
{
char addrbuf_prev[INET_NTOA_BUF_LEN];
char addrbuf_cur[INET_NTOA_BUF_LEN];
@@ -911,10 +911,10 @@ log_addr_has_changed(uint32_t prev, uint32_t cur)
tor_inet_ntoa(&in_cur, addrbuf_cur, sizeof(addrbuf_cur));
if (prev)
- log_info(LD_GENERAL,
- "Our IP Address has changed from %s to %s; "
- "rebuilding descriptor.",
- addrbuf_prev, addrbuf_cur);
+ log_fn(severity, LD_GENERAL,
+ "Our IP Address has changed from %s to %s; "
+ "rebuilding descriptor.",
+ addrbuf_prev, addrbuf_cur);
else
log_notice(LD_GENERAL,
"Guessed our IP address as %s.",
@@ -941,7 +941,7 @@ check_descriptor_ipaddress_changed(time_t now)
}
if (prev != cur) {
- log_addr_has_changed(prev, cur);
+ log_addr_has_changed(LOG_INFO, prev, cur);
mark_my_descriptor_dirty();
/* the above call is probably redundant, since resolve_my_address()
* probably already noticed and marked it dirty. */
@@ -973,7 +973,7 @@ router_new_address_suggestion(const char *suggestion)
}
if (last_guessed_ip != addr) {
- log_addr_has_changed(last_guessed_ip, addr);
+ log_addr_has_changed(LOG_NOTICE, last_guessed_ip, addr);
server_has_changed_ip();
last_guessed_ip = addr; /* router_rebuild_descriptor() will fetch it */
}