aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-02-12 12:21:57 +1000
committerteor <teor@torproject.org>2020-02-12 12:21:57 +1000
commit5298113da98f13cfaad4a9ab7b5ac8baa6c37279 (patch)
treea85d0e8f6be3c4195f538592718d7c7ef5e2b612 /src/feature/relay
parent0ff3e8f4a0fd5b661e999c0a81ceb1c55e7456c6 (diff)
parentb9c7c61ea5233854ff83257a8bc530b7e0a50351 (diff)
downloadtor-5298113da98f13cfaad4a9ab7b5ac8baa6c37279.tar.gz
tor-5298113da98f13cfaad4a9ab7b5ac8baa6c37279.zip
Merge branch 'maint-0.3.5' into maint-0.4.1
Diffstat (limited to 'src/feature/relay')
-rw-r--r--src/feature/relay/router.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index 29a8ffaa39..2b28bd229c 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -2911,15 +2911,20 @@ router_dump_router_to_string(routerinfo_t *router,
}
if (options->BridgeRelay) {
- const char *bd;
+ char *bd = NULL;
+
if (options->BridgeDistribution && strlen(options->BridgeDistribution)) {
- bd = options->BridgeDistribution;
+ bd = tor_strdup(options->BridgeDistribution);
} else {
- bd = "any";
+ bd = tor_strdup("any");
}
- if (strchr(bd, '\n') || strchr(bd, '\r'))
- bd = escaped(bd);
+
+ // Make sure our value is lowercased in the descriptor instead of just
+ // forwarding what the user wrote in their torrc directly.
+ tor_strlower(bd);
+
smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n", bd);
+ tor_free(bd);
}
if (router->onion_curve25519_pkey) {