]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Several geoip changes/fixes as requested.
authorNick Mathewson <nickm@torproject.org>
Wed, 28 May 2008 18:31:57 +0000 (18:31 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 28 May 2008 18:31:57 +0000 (18:31 +0000)
svn:r14780

ChangeLog
doc/TODO
doc/spec/proposals/117-ipv6-exits.txt
src/or/directory.c
src/or/geoip.c
src/or/router.c

index 15cd5883d33c9e25e280797487bb764a34dd70d9..39d6161d930001f79a26ef12bf76232019d0162e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -100,6 +100,8 @@ Changes in version 0.2.1.1-alpha - 2008-??-??
       before too long.
     - Add a "PURPOSE=" argument to "STREAM NEW" events, as suggested by
       Robert Hogan. Fixes the first part of bug 681.
+    - Make bridge authorities never serve extrainfo docs.
+    - Allow comments in geoip file.
 
   o Minor features (security):
     - Reject requests for reverse-dns lookup of names in a private
index e6696f0a4dcff85931c5d16f8113d438e623fb31..085789be3473e309645cd46eaab6dae941b4518c 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -44,7 +44,7 @@ S   - More TorBrowser work
       - Figure out (or give up on) how to run Tor Browser and ordinary
         Firefox side-by-side.
 N   - Write a script to correctly total bandwidth-history observations
-N+P - Make sure RPMs can build correctly with geoip file
+    o Make sure RPMs can build correctly with geoip file
 N+P - Make sure other packages build correctly with geoip file
 N   - Write a paragraph or two for Paul's research project describing what
       we plan to help him research. Roger will then secretly retitle
@@ -280,16 +280,19 @@ Mike:
 =======================================================================
 
 Bugs/issues for Tor 0.2.0.x:
-N - Rip out the MIN_IPS_* stuff for geoip reporting.
-N - bridge authorities should not serve extrainfo docs.
-N - We still never call geoip_remove_old_clients(). Should we call it,
+  o Rip out the MIN_IPS_* stuff for geoip reporting.
+  o bridge authorities should not serve extrainfo docs.
+  o We still never call geoip_remove_old_clients(). Should we call it,
     with a cutoff of a day ago, each time we're about to build a
     descriptor/extrainfo pair?
-N - teach geoip_parse_entry() to skip over lines that start with #, so we
+    o Actually, let's do it every 48 hours, so we don't wind up saying
+      too much.
+  o teach geoip_parse_entry() to skip over lines that start with #, so we
     can put a little note at the top of the geoip file to say what it is.
 N d we should have an off-by-default way for relays to dump geoip data to
-    a file in their data directory, for measurement purposes.  it should be
-    listed along with their probability-of-selection
+    a file in their data directory, for measurement purposes.
+    - Basic implementation
+    - Include probability-of-selection
 R d let bridges set relaybandwidthrate as low as 5kb
 R - bug: if we launch using bridges, and then stop using bridges, we
     still have our bridges in our entryguards section, and may use them.
index ff4670fa5824c6ae01aba8740451dcee9a1fdf87..c3bb149fd9912999301847cb0b2da8b4952481cd 100644 (file)
@@ -86,6 +86,8 @@ Contents
    (RELAY_RESOLVE) should perform and respond with both A and AAAA
    resources.
 
+   [NOTE: In a future version, it may make sense to .]
+
 1.4. Client interaction with IPv6 exit capability
 
 1.4.1. Usability goals
index 05dccb0fd60fa6cfa7eee90b3f34841be29ff17b..e753df85eb0ed706c5437a05f59f5ed00ac82374 100644 (file)
@@ -2598,7 +2598,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
   }
 
   if (!strcmpstart(url,"/tor/server/") ||
-      !strcmpstart(url,"/tor/extra/")) {
+      (!options->BridgeAuthoritativeDir && !strcmpstart(url,"/tor/extra/"))) {
     int res;
     const char *msg;
     const char *request_type = NULL;
index 97ea9d7eb4b827eae1fa3500d714c59d11f3b9a7..b3e993b25fce5bab9691ebe5f7884ca803f94f47 100644 (file)
@@ -76,6 +76,10 @@ geoip_parse_entry(const char *line)
     geoip_entries = smartlist_create();
     country_idxplus1_by_lc_code = strmap_new();
   }
+  while (TOR_ISSPACE(*line))
+    ++line;
+  if (*line == '#')
+    return 0;
   if (sscanf(line,"%u,%u,%2s", &low, &high, b) == 3) {
     geoip_add_entry(low, high, b);
     return 0;
@@ -277,12 +281,12 @@ geoip_remove_old_clients(time_t cutoff)
 }
 
 /** Do not mention any country from which fewer than this number of IPs have
- * connected.  This avoids reporting information that could deanonymize
- * users. */
-#define MIN_IPS_TO_NOTE_COUNTRY 8
+ * connected.  This conceivably avoids reporting information that could
+ * deanonymize users, though analysis is lacking. */
+#define MIN_IPS_TO_NOTE_COUNTRY 0
 /** Do not report any geoip data at all if we have fewer than this number of
  * IPs to report about. */
-#define MIN_IPS_TO_NOTE_ANYTHING 16
+#define MIN_IPS_TO_NOTE_ANYTHING 0
 /** When reporting geoip data about countries, round up to the nearest
  * multiple of this value. */
 #define IP_GRANULARITY 8
index eb09ac4947d077473a02fd8488c3a99f63b28629..8f2bf65482422428a508d123a0323107e839d185 100644 (file)
@@ -1823,7 +1823,14 @@ extrainfo_dump_to_string(char *s, size_t maxlen, extrainfo_t *extrainfo,
     return -1;
 
   if (options->BridgeRelay && options->BridgeRecordUsageByCountry) {
-    char *geoip_summary = geoip_get_client_history(time(NULL));
+    static time_t last_purged_at = 0;
+    char *geoip_summary;
+    time_t now = time(NULL);
+    if (now > last_purged_at+48*60*60) {
+      geoip_remove_old_clients(now-48*60*60);
+      last_purged_at = now;
+    }
+    geoip_summary = geoip_get_client_history(time(NULL));
     if (geoip_summary) {
       char geoip_start[ISO_TIME_LEN+1];
       format_iso_time(geoip_start, geoip_get_history_start());