]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use DirPort for uploading descriptors.
authorNick Mathewson <nickm@torproject.org>
Thu, 15 May 2014 01:49:57 +0000 (21:49 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 15 May 2014 01:49:57 +0000 (21:49 -0400)
When we converted the horrible set of options that previously
controlled "use ORPort or DirPort? Anonymously or Non-anonymouly?" to
a single 'indirection' argument, we missed
directory_post_to_dirservers.

The problematic code was introduced in 5cbeb6080, which went into
0.2.4.3-alpha.  This is a fix for bug 11469.

changes/bug11469 [new file with mode: 0644]
src/or/directory.c

diff --git a/changes/bug11469 b/changes/bug11469
new file mode 100644 (file)
index 0000000..8517d38
--- /dev/null
@@ -0,0 +1,6 @@
+  o Major bugfixes (relay):
+    - When uploading to the directory authorities, use a direct dirport
+      connection if we are a uploading an ordinary, non-anonymous directory
+      object. Previously, relays would used tunnel connections under a
+      fairly wide variety of circumstances. Fixes bug 11469; bugfix on
+      0.2.4.3-alpha.
index 3752367c448bbff7fdbf4dae941bc562fe729677..494d371104260d103cf4646a4202830365e79c48 100644 (file)
@@ -279,7 +279,7 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
                              size_t payload_len, size_t extrainfo_len)
 {
   const or_options_t *options = get_options();
-  int post_via_tor;
+  dir_indirection_t indirection;
   const smartlist_t *dirservers = router_get_trusted_dir_servers();
   int found = 0;
   const int exclude_self = (dir_purpose == DIR_PURPOSE_UPLOAD_VOTE ||
@@ -319,11 +319,19 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
                  (int) extrainfo_len);
       }
       tor_addr_from_ipv4h(&ds_addr, ds->addr);
-      post_via_tor = purpose_needs_anonymity(dir_purpose, router_purpose) ||
-        !fascist_firewall_allows_address_dir(&ds_addr, ds->dir_port);
+      if (purpose_needs_anonymity(dir_purpose, router_purpose)) {
+        indirection = DIRIND_ANONYMOUS;
+      } else if (!fascist_firewall_allows_address_dir(&ds_addr,ds->dir_port)) {
+        if (fascist_firewall_allows_address_or(&ds_addr,ds->or_port))
+          indirection = DIRIND_ONEHOP;
+        else
+          indirection = DIRIND_ANONYMOUS;
+      } else {
+        indirection = DIRIND_DIRECT_CONN;
+      }
       directory_initiate_command_routerstatus(rs, dir_purpose,
                                               router_purpose,
-                                              post_via_tor,
+                                              indirection,
                                               NULL, payload, upload_len, 0);
   } SMARTLIST_FOREACH_END(ds);
   if (!found) {