aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendmid.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-01-30 09:33:12 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-01-30 09:33:12 -0500
commitcd81403cc0d73d53cb7f3650b38d49c54100af25 (patch)
tree5ea4f0c626ad082fb195a478614f67dff1a7b386 /src/or/rendmid.c
parent03ab24b44cd148263cfb2b801cba35489e3852c1 (diff)
parent9aca7d47306222f2870ec16a7291a8215d6c3316 (diff)
downloadtor-cd81403cc0d73d53cb7f3650b38d49c54100af25.tar.gz
tor-cd81403cc0d73d53cb7f3650b38d49c54100af25.zip
Merge branch 'ticket24902_029_05' into ticket24902_033_02
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r--src/or/rendmid.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 66d2f93113..c4a34ca62c 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -8,10 +8,12 @@
**/
#include "or.h"
+#include "channel.h"
#include "circuitlist.h"
#include "circuituse.h"
#include "config.h"
#include "crypto.h"
+#include "dos.h"
#include "relay.h"
#include "rendmid.h"
#include "rephist.h"
@@ -231,6 +233,16 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
goto err;
}
+ /* Check if we are configured to accept established rendezvous cells from
+ * client or in other words tor2web clients. */
+ if (channel_is_client(circ->p_chan) &&
+ dos_should_refuse_single_hop_client()) {
+ /* Note it down for the heartbeat log purposes. */
+ dos_note_refuse_single_hop_client();
+ /* Silent drop so the client has to time out before moving on. */
+ return 0;
+ }
+
if (circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
"Tried to establish rendezvous on non-edge circuit");