aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/router.c5
-rw-r--r--src/or/test.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 794f5473e..9e85d7755 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -619,7 +619,10 @@ decide_to_advertise_dirport(or_options_t *options, routerinfo_t *router)
/* if we might potentially hibernate */
new_choice = 0;
reason = "AccountingMax enabled";
- } else if (router->bandwidthrate < 51200) {
+#define MIN_BW_TO_ADVERTISE_DIRPORT 51200
+ } else if (options->BandwidthRate < MIN_BW_TO_ADVERTISE_DIRPORT ||
+ (options->RelayBandwidthRate > 0 &&
+ options->RelayBandwidthRate < MIN_BW_TO_ADVERTISE_DIRPORT)) {
/* if we're advertising a small amount */
new_choice = 0;
reason = "BandwidthRate under 50KB";
diff --git a/src/or/test.c b/src/or/test.c
index bb673f953..b420222d3 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -2163,7 +2163,7 @@ test_dir_format(void)
memset(buf, 0, 2048);
test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
- strlcpy(buf2, "router Magri 18.244.0.1 9000 0 0\n"
+ strlcpy(buf2, "router Magri 18.244.0.1 9000 0 9003\n"
"platform Tor "VERSION" on ", sizeof(buf2));
strlcat(buf2, get_uname(), sizeof(buf2));
strlcat(buf2, "\n"