[or-cvs] [tor/maint-0.2.2] log when we guess our ip address, not just when we fail

arma at torproject.org arma at torproject.org
Fri Oct 1 17:33:47 UTC 2010


Author: Roger Dingledine <arma at torproject.org>
Date: Fri, 1 Oct 2010 13:32:38 -0400
Subject: log when we guess our ip address, not just when we fail
Commit: 6cb5383e564f37e681df922ffddc1894bf8b35fa

---
 changes/bug1534 |    6 ++++++
 src/or/router.c |    5 +++++
 2 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 changes/bug1534

diff --git a/changes/bug1534 b/changes/bug1534
new file mode 100644
index 0000000..523391f
--- /dev/null
+++ b/changes/bug1534
@@ -0,0 +1,6 @@
+  o Minor bugfixes:
+    - When we're trying to guess whether we know our IP address as
+      a relay, we would log various ways that we failed to guess
+      our address, but never log that we ended up guessing it
+      successfully. Now add a log line to help confused and anxious
+      relay operators. Bugfix on 0.1.2.1-alpha; fixes bug 1534.
diff --git a/src/or/router.c b/src/or/router.c
index 621cbaa..56d8826 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1257,6 +1257,8 @@ static int router_guess_address_from_dir_headers(uint32_t *guess);
 int
 router_pick_published_address(or_options_t *options, uint32_t *addr)
 {
+  char buf[INET_NTOA_BUF_LEN];
+  struct in_addr a;
   if (resolve_my_address(LOG_INFO, options, addr, NULL) < 0) {
     log_info(LD_CONFIG, "Could not determine our address locally. "
              "Checking if directory headers provide any hints.");
@@ -1266,6 +1268,9 @@ router_pick_published_address(or_options_t *options, uint32_t *addr)
       return -1;
     }
   }
+  a.s_addr = htonl(*addr);
+  tor_inet_ntoa(&a, buf, sizeof(buf));
+  log_info(LD_CONFIG,"Success: chose address '%s'.", buf);
   return 0;
 }
 
-- 
1.7.1



More information about the tor-commits mailing list