Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
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
jarl
tor
Commits
d2ab58c4
Commit
d2ab58c4
authored
8 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'bug18357_v2'
parents
07f2e574
87865c8a
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/bug18357
+5
-0
5 additions, 0 deletions
changes/bug18357
src/or/connection_edge.c
+30
-8
30 additions, 8 deletions
src/or/connection_edge.c
with
35 additions
and
8 deletions
changes/bug18357
0 → 100644
+
5
−
0
View file @
d2ab58c4
o Minor bugfixes (hidden service):
- Allow hidden services to run on IPv6 addresses even when the
IPv6Exit option is not set. Fixes bug 18357; bugfix on
0.2.4.7-alpha.
This diff is collapsed.
Click to expand it.
src/or/connection_edge.c
+
30
−
8
View file @
d2ab58c4
...
...
@@ -3218,6 +3218,24 @@ connection_exit_begin_resolve(cell_t *cell, or_circuit_t *circ)
return
0
;
}
/** Helper: Return true and set *<b>why_rejected</b> to an optional clarifying
* message message iff we do not allow connections to <b>addr</b>:<b>port</b>.
*/
static
int
my_exit_policy_rejects
(
const
tor_addr_t
*
addr
,
uint16_t
port
,
const
char
**
why_rejected
)
{
if
(
router_compare_to_my_exit_policy
(
addr
,
port
))
{
*
why_rejected
=
""
;
return
1
;
}
else
if
(
tor_addr_family
(
addr
)
==
AF_INET6
&&
!
get_options
()
->
IPv6Exit
)
{
*
why_rejected
=
" (IPv6 address without IPv6Exit configured)"
;
return
1
;
}
return
0
;
}
/** Connect to conn's specified addr and port. If it worked, conn
* has now been added to the connection_array.
*
...
...
@@ -3232,14 +3250,18 @@ connection_exit_connect(edge_connection_t *edge_conn)
uint16_t
port
;
connection_t
*
conn
=
TO_CONN
(
edge_conn
);
int
socket_error
=
0
,
result
;
if
(
(
!
connection_edge_is_rendezvous_stream
(
edge_conn
)
&&
router_compare_to_my_exit_policy
(
&
edge_conn
->
base_
.
addr
,
edge_conn
->
base_
.
port
))
||
(
tor_addr_family
(
&
conn
->
addr
)
==
AF_INET6
&&
!
get_options
()
->
IPv6Exit
))
{
log_info
(
LD_EXIT
,
"%s:%d failed exit policy. Closing."
,
escaped_safe_str_client
(
conn
->
address
),
conn
->
port
);
const
char
*
why_failed_exit_policy
=
NULL
;
/* Apply exit policy to non-rendezvous connections. */
if
(
!
connection_edge_is_rendezvous_stream
(
edge_conn
)
&&
my_exit_policy_rejects
(
&
edge_conn
->
base_
.
addr
,
edge_conn
->
base_
.
port
,
&
why_failed_exit_policy
))
{
if
(
BUG
(
!
why_failed_exit_policy
))
why_failed_exit_policy
=
""
;
log_info
(
LD_EXIT
,
"%s:%d failed exit policy%s. Closing."
,
escaped_safe_str_client
(
conn
->
address
),
conn
->
port
,
why_failed_exit_policy
);
connection_edge_end
(
edge_conn
,
END_STREAM_REASON_EXITPOLICY
);
circuit_detach_stream
(
circuit_get_by_edge_conn
(
edge_conn
),
edge_conn
);
connection_free
(
conn
);
...
...
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