aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2016-11-13 02:39:16 -0500
committerNick Mathewson <nickm@torproject.org>2017-10-24 19:26:24 -0400
commitebab5215252f9fa810ae091c335c5ae6e619faaf (patch)
tree1e4bd4e7751f48dd93d31de404014653a92d8d3b /src/or/router.c
parentfcd5c3144a44f4081e9e7c4336b932e31ae45f77 (diff)
downloadtor-ebab5215252f9fa810ae091c335c5ae6e619faaf.tar.gz
tor-ebab5215252f9fa810ae091c335c5ae6e619faaf.zip
Add new BridgeDistribution config option
Bridge relays can use it to add a "bridge-distribution-request" line to their bridge descriptor, which tells BridgeDB how they'd like their bridge address to be given out. Implements tickets 18329.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 6d3a32a60c..780d0444f3 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2867,6 +2867,14 @@ router_dump_router_to_string(routerinfo_t *router,
smartlist_add_asprintf(chunks, "contact %s\n", ci);
}
+ if (options->BridgeRelay && options->BridgeDistribution &&
+ strlen(options->BridgeDistribution)) {
+ const char *bd = options->BridgeDistribution;
+ if (strchr(bd, '\n') || strchr(bd, '\r'))
+ bd = escaped(bd);
+ smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n", bd);
+ }
+
if (router->onion_curve25519_pkey) {
char kbuf[128];
base64_encode(kbuf, sizeof(kbuf),