From 613b18f0afd865b0fc5daf8d17da241396100dcd Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 23 Oct 2017 10:52:42 -0400 Subject: 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. --- src/or/router.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/or/router.c') 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); -- cgit v1.2.3-54-g00ecf