aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2020-08-25 14:51:05 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2020-08-25 14:51:05 +0300
commit1397a86bbda04fbcf3e902282ccb4dd689821ea1 (patch)
tree511c9b8851995031de6bf3f8ceb5d85ebb19531e /src/feature
parent6e37086f85aa3e421ebc6f4d64de1cd82bcdeaa6 (diff)
parentf5c9f6d4327d7dcd36081426c0a862b6a06a2b61 (diff)
downloadtor-1397a86bbda04fbcf3e902282ccb4dd689821ea1.tar.gz
tor-1397a86bbda04fbcf3e902282ccb4dd689821ea1.zip
Merge remote-tracking branch 'tor-gitlab/mr/130' into maint-0.4.4
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_dos.c5
-rw-r--r--src/feature/hs/hs_intropoint.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/feature/hs/hs_dos.c b/src/feature/hs/hs_dos.c
index 1f7415a280..04c2bfbb89 100644
--- a/src/feature/hs/hs_dos.c
+++ b/src/feature/hs/hs_dos.c
@@ -93,6 +93,11 @@ update_intro_circuits(void)
smartlist_t *intro_circs = hs_circuitmap_get_all_intro_circ_relay_side();
SMARTLIST_FOREACH_BEGIN(intro_circs, circuit_t *, circ) {
+ /* Ignore circuit if the defenses were set explicitly through the
+ * ESTABLISH_INTRO cell DoS extension. */
+ if (TO_OR_CIRCUIT(circ)->introduce2_dos_defense_explicit) {
+ continue;
+ }
/* Defenses might have been enabled or disabled. */
TO_OR_CIRCUIT(circ)->introduce2_dos_defense_enabled =
consensus_param_introduce_defense_enabled;
diff --git a/src/feature/hs/hs_intropoint.c b/src/feature/hs/hs_intropoint.c
index e282d1f1bd..69d60f21c3 100644
--- a/src/feature/hs/hs_intropoint.c
+++ b/src/feature/hs/hs_intropoint.c
@@ -285,6 +285,11 @@ handle_establish_intro_cell_dos_extension(
}
}
+ /* At this point, the extension is valid so any values out of it implies
+ * that it was set explicitly and thus flag the circuit that it should not
+ * look at the consensus for that reason for the defenses' values. */
+ circ->introduce2_dos_defense_explicit = 1;
+
/* A value of 0 is valid in the sense that we accept it but we still disable
* the defenses so return false. */
if (intro2_rate_per_sec == 0 || intro2_burst_per_sec == 0) {