]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Minimal implementation of bridge-distribution-request
authorNick Mathewson <nickm@torproject.org>
Tue, 14 Nov 2017 01:44:51 +0000 (20:44 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 14 Nov 2017 01:44:51 +0000 (20:44 -0500)
Just advertise the line when we're a bridge, using "any" if we're
published or "none" if we aren't.

This is done in lieu of a full backport of #18329.

changes/bug18329-minimal [new file with mode: 0644]
src/or/router.c

diff --git a/changes/bug18329-minimal b/changes/bug18329-minimal
new file mode 100644 (file)
index 0000000..804c4e8
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor features (bridge):
+    - Bridges now include notice in their descriptors that they are bridges,
+      and notice of their distribution status, based on their publication
+      settings.  Implements ticket 18329.  For more fine-grained control of
+      how a bridge is distributed, upgrade to 0.3.2.x or later.
+
index 2cdbb0c8bb14a8500b83eafc8115a90aec348134..90b2431a222b5096bafed2186784c0706e5c333b 100644 (file)
@@ -2385,6 +2385,15 @@ router_dump_router_to_string(routerinfo_t *router,
     smartlist_add_asprintf(chunks, "contact %s\n", ci);
   }
 
+  if (options->BridgeRelay) {
+    const char *bd;
+    if (options->PublishServerDescriptor_ & BRIDGE_DIRINFO)
+      bd = "any";
+    else
+      bd = "none";
+    smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n", bd);
+  }
+
 #ifdef CURVE25519_ENABLED
   if (router->onion_curve25519_pkey) {
     char kbuf[128];