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
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
sergi
Tor
Commits
7f9eaec5
Commit
7f9eaec5
authored
5 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'tor-github/pr/1862/head'
parents
b2849f44
8c55d34e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/bug33899
+9
-0
9 additions, 0 deletions
changes/bug33899
src/core/or/connection_or.c
+18
-8
18 additions, 8 deletions
src/core/or/connection_or.c
src/core/or/connection_or.h
+0
-4
0 additions, 4 deletions
src/core/or/connection_or.h
with
27 additions
and
12 deletions
changes/bug33899
0 → 100644
+
9
−
0
View file @
7f9eaec5
o Minor bugfixes (IPv6, relay):
- Consider IPv6 addresses when checking if a connection is canonical.
In 17604, relays assumed that a remote relay could consider an IPv6
connection canonical, but did not set the canonical flag on their side
of the connection. Fixes bug 33899; bugfix on 0.3.1.1-alpha.
- Log IPv6 addresses on connections where this relay is the responder.
Previously, responding relays would replace the remote IPv6 address with
the IPv4 address from the consensus.
Fixes bug 33899; bugfix on 0.3.1.1-alpha.
This diff is collapsed.
Click to expand it.
src/core/or/connection_or.c
+
18
−
8
View file @
7f9eaec5
...
...
@@ -902,12 +902,21 @@ connection_or_check_canonicity(or_connection_t *conn, int started_here)
}
if
(
r
)
{
tor_addr_port_t
node_ap
;
node_get_pref_orport
(
r
,
&
node_ap
);
/* XXXX proposal 186 is making this more complex. For now, a conn
is canonical when it uses the _preferred_ address. */
if
(
tor_addr_eq
(
&
conn
->
base_
.
addr
,
&
node_ap
.
addr
))
tor_addr_port_t
node_ipv4_ap
;
tor_addr_port_t
node_ipv6_ap
;
node_get_prim_orport
(
r
,
&
node_ipv4_ap
);
node_get_pref_ipv6_orport
(
r
,
&
node_ipv6_ap
);
if
(
tor_addr_eq
(
&
conn
->
base_
.
addr
,
&
node_ipv4_ap
.
addr
)
||
tor_addr_eq
(
&
conn
->
base_
.
addr
,
&
node_ipv6_ap
.
addr
))
{
connection_or_set_canonical
(
conn
,
1
);
}
/* Choose the correct canonical address and port. */
tor_addr_port_t
*
node_ap
;
if
(
tor_addr_family
(
&
conn
->
base_
.
addr
)
==
AF_INET
)
{
node_ap
=
&
node_ipv4_ap
;
}
else
{
node_ap
=
&
node_ipv6_ap
;
}
if
(
!
started_here
)
{
/* Override the addr/port, so our log messages will make sense.
* This is dangerous, since if we ever try looking up a conn by
...
...
@@ -919,13 +928,14 @@ connection_or_check_canonicity(or_connection_t *conn, int started_here)
* right IP address and port 56244, that wouldn't be as helpful. now we
* log the "right" port too, so we know if it's moria1 or moria2.
*/
tor_addr_copy
(
&
conn
->
base_
.
addr
,
&
node_ap
.
addr
);
conn
->
base_
.
port
=
node_ap
.
port
;
/* See #33898 for a ticket that resolves this technical debt. */
tor_addr_copy
(
&
conn
->
base_
.
addr
,
&
node_ap
->
addr
);
conn
->
base_
.
port
=
node_ap
->
port
;
}
tor_free
(
conn
->
nickname
);
conn
->
nickname
=
tor_strdup
(
node_get_nickname
(
r
));
tor_free
(
conn
->
base_
.
address
);
conn
->
base_
.
address
=
tor_addr_to_str_dup
(
&
node_ap
.
addr
);
conn
->
base_
.
address
=
tor_addr_to_str_dup
(
&
node_ap
->
addr
);
}
else
{
tor_free
(
conn
->
nickname
);
conn
->
nickname
=
tor_malloc
(
HEX_DIGEST_LEN
+
2
);
...
...
This diff is collapsed.
Click to expand it.
src/core/or/connection_or.h
+
0
−
4
View file @
7f9eaec5
...
...
@@ -22,10 +22,6 @@ or_connection_t *TO_OR_CONN(connection_t *);
void
connection_or_clear_identity
(
or_connection_t
*
conn
);
void
connection_or_clear_identity_map
(
void
);
void
clear_broken_connection_map
(
int
disable
);
or_connection_t
*
connection_or_get_for_extend
(
const
char
*
digest
,
const
tor_addr_t
*
target_addr
,
const
char
**
msg_out
,
int
*
launch_out
);
void
connection_or_block_renegotiation
(
or_connection_t
*
conn
);
int
connection_or_reached_eof
(
or_connection_t
*
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