Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
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
debian
tor
Commits
cfca2a60
Commit
cfca2a60
authored
10 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'bug12191_squashed'
parents
bbb1ffe5
f9f450d6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug12191
+7
-0
7 additions, 0 deletions
changes/bug12191
src/or/command.c
+28
-25
28 additions, 25 deletions
src/or/command.c
with
35 additions
and
25 deletions
changes/bug12191
0 → 100644
+
7
−
0
View file @
cfca2a60
o Minor bugfixes:
- We now drop CREATE cells for already-existent circuit IDs and
for zero-valued circuit IDs, regardless of other factors that
might otherwise have called for DESTROY cells. Fixes bug 12191;
bugfix on 0.0.8pre1.
This diff is collapsed.
Click to expand it.
src/or/command.c
+
28
−
25
View file @
cfca2a60
...
...
@@ -227,6 +227,34 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
(
unsigned
)
cell
->
circ_id
,
U64_PRINTF_ARG
(
chan
->
global_identifier
),
chan
);
/* We check for the conditions that would make us drop the cell before
* we check for the conditions that would make us send a DESTROY back,
* since those conditions would make a DESTROY nonsensical. */
if
(
cell
->
circ_id
==
0
)
{
log_fn
(
LOG_PROTOCOL_WARN
,
LD_PROTOCOL
,
"Received a create cell (type %d) from %s with zero circID; "
" ignoring."
,
(
int
)
cell
->
command
,
channel_get_actual_remote_descr
(
chan
));
return
;
}
if
(
circuit_id_in_use_on_channel
(
cell
->
circ_id
,
chan
))
{
const
node_t
*
node
=
node_get_by_id
(
chan
->
identity_digest
);
log_fn
(
LOG_PROTOCOL_WARN
,
LD_PROTOCOL
,
"Received CREATE cell (circID %u) for known circ. "
"Dropping (age %d)."
,
(
unsigned
)
cell
->
circ_id
,
(
int
)(
time
(
NULL
)
-
channel_when_created
(
chan
)));
if
(
node
)
{
char
*
p
=
esc_for_log
(
node_get_platform
(
node
));
log_fn
(
LOG_PROTOCOL_WARN
,
LD_PROTOCOL
,
"Details: router %s, platform %s."
,
node_describe
(
node
),
p
);
tor_free
(
p
);
}
return
;
}
if
(
we_are_hibernating
())
{
log_info
(
LD_OR
,
"Received create cell but we're shutting down. Sending back "
...
...
@@ -248,14 +276,6 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
return
;
}
if
(
cell
->
circ_id
==
0
)
{
log_fn
(
LOG_PROTOCOL_WARN
,
LD_PROTOCOL
,
"Received a create cell (type %d) from %s with zero circID; "
" ignoring."
,
(
int
)
cell
->
command
,
channel_get_actual_remote_descr
(
chan
));
return
;
}
/* If the high bit of the circuit ID is not as expected, close the
* circ. */
if
(
chan
->
wide_circ_ids
)
...
...
@@ -274,23 +294,6 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
return
;
}
if
(
circuit_id_in_use_on_channel
(
cell
->
circ_id
,
chan
))
{
const
node_t
*
node
=
node_get_by_id
(
chan
->
identity_digest
);
log_fn
(
LOG_PROTOCOL_WARN
,
LD_PROTOCOL
,
"Received CREATE cell (circID %u) for known circ. "
"Dropping (age %d)."
,
(
unsigned
)
cell
->
circ_id
,
(
int
)(
time
(
NULL
)
-
channel_when_created
(
chan
)));
if
(
node
)
{
char
*
p
=
esc_for_log
(
node_get_platform
(
node
));
log_fn
(
LOG_PROTOCOL_WARN
,
LD_PROTOCOL
,
"Details: router %s, platform %s."
,
node_describe
(
node
),
p
);
tor_free
(
p
);
}
return
;
}
circ
=
or_circuit_new
(
cell
->
circ_id
,
chan
);
circ
->
base_
.
purpose
=
CIRCUIT_PURPOSE_OR
;
circuit_set_state
(
TO_CIRCUIT
(
circ
),
CIRCUIT_STATE_ONIONSKIN_PENDING
);
...
...
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