summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-10-23 10:52:42 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-24 19:26:24 -0400
commit613b18f0afd865b0fc5daf8d17da241396100dcd (patch)
treec45626e051ec669c6212eb976b616cb07d608681 /src/or/router.c
parent3581f93d273dfd9fbc56de907b7e3b77575614e1 (diff)
downloadtor-613b18f0afd865b0fc5daf8d17da241396100dcd.tar.gz
tor-613b18f0afd865b0fc5daf8d17da241396100dcd.zip
Always set bridge-distribution-request on bridges' descriptors.
Also, warn the user if the BridgeDistribution option is unrecognized, and reject the value if it is invalid.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 780d0444f3..553264efa8 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2867,9 +2867,13 @@ 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 (options->BridgeRelay) {
+ const char *bd;
+ if (options->BridgeDistribution && strlen(options->BridgeDistribution)) {
+ bd = options->BridgeDistribution;
+ } else {
+ bd = "any";
+ }
if (strchr(bd, '\n') || strchr(bd, '\r'))
bd = escaped(bd);
smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n", bd);