Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
a2aaf950
Commit
a2aaf950
authored
7 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'dgoulet/bug24895_029_02' into maint-0.2.9
parents
36567c5c
490ae26b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug24895
+8
-0
8 additions, 0 deletions
changes/bug24895
src/or/rendservice.c
+24
-5
24 additions, 5 deletions
src/or/rendservice.c
with
32 additions
and
5 deletions
changes/bug24895
0 → 100644
+
8
−
0
View file @
a2aaf950
o Major bugfixes (onion services):
- Fix an "off by 2" error in counting rendezvous failures on the onion
service side. While we thought we would stop the rendezvous attempt
after one failed circuit, we were actually making three circuit attempts
before giving up. Now switch to a default of 2, and allow the consensus
parameter "hs_service_max_rdv_failures" to override. Fixes bug 24895;
bugfix on 0.0.6.
This diff is collapsed.
Click to expand it.
src/or/rendservice.c
+
24
−
5
View file @
a2aaf950
...
...
@@ -108,12 +108,25 @@ struct rend_service_port_config_s {
/** Don't try to build more than this many circuits before giving up
* for a while.*/
#define MAX_INTRO_CIRCS_PER_PERIOD 10
/** How many times will a hidden service operator attempt to connect to
* a requested rendezvous point before giving up? */
#define MAX_REND_FAILURES 1
/** How many seconds should we spend trying to connect to a requested
* rendezvous point before giving up? */
#define MAX_REND_TIMEOUT 30
/* Default, minimum and maximum values for the maximum rendezvous failures
* consensus parameter. */
#define MAX_REND_FAILURES_DEFAULT 2
#define MAX_REND_FAILURES_MIN 1
#define MAX_REND_FAILURES_MAX 10
/** How many times will a hidden service operator attempt to connect to
* a requested rendezvous point before giving up? */
static
int
get_max_rend_failures
(
void
)
{
return
networkstatus_get_param
(
NULL
,
"hs_service_max_rdv_failures"
,
MAX_REND_FAILURES_DEFAULT
,
MAX_REND_FAILURES_MIN
,
MAX_REND_FAILURES_MAX
);
}
/* Hidden service directory file names:
* new file names should be added to rend_service_add_filenames_to_list()
...
...
@@ -2028,7 +2041,8 @@ rend_service_receive_introduction(origin_circuit_t *circuit,
/* Launch a circuit to the client's chosen rendezvous point.
*/
for
(
i
=
0
;
i
<
MAX_REND_FAILURES
;
i
++
)
{
int
max_rend_failures
=
get_max_rend_failures
();
for
(
i
=
0
;
i
<
max_rend_failures
;
i
++
)
{
int
flags
=
CIRCLAUNCH_NEED_CAPACITY
|
CIRCLAUNCH_IS_INTERNAL
;
if
(
circ_needs_uptime
)
flags
|=
CIRCLAUNCH_NEED_UPTIME
;
/* A Single Onion Service only uses a direct connection if its
...
...
@@ -2930,8 +2944,13 @@ rend_service_relaunch_rendezvous(origin_circuit_t *oldcirc)
}
oldcirc
->
hs_service_side_rend_circ_has_been_relaunched
=
1
;
/* We check failure_count >= get_max_rend_failures()-1 below, and the -1
* is because we increment the failure count for our current failure
* *after* this clause. */
int
max_rend_failures
=
get_max_rend_failures
()
-
1
;
if
(
!
oldcirc
->
build_state
||
oldcirc
->
build_state
->
failure_count
>
MAX_REND_FAILURES
||
oldcirc
->
build_state
->
failure_count
>
=
max_rend_failures
||
oldcirc
->
build_state
->
expiry_time
<
time
(
NULL
))
{
log_info
(
LD_REND
,
"Attempt to build circuit to %s for rendezvous has failed "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment