diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-10-23 10:52:42 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-10-24 19:26:24 -0400 |
commit | 613b18f0afd865b0fc5daf8d17da241396100dcd (patch) | |
tree | c45626e051ec669c6212eb976b616cb07d608681 /src/or/router.c | |
parent | 3581f93d273dfd9fbc56de907b7e3b77575614e1 (diff) | |
download | tor-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.c | 10 |
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); |