aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuitbuild.c
AgeCommit message (Collapse)Author
2020-10-20Merge remote-tracking branch 'tor-gitlab/mr/148' into masterGeorge Kadianakis
2020-10-19Explain why we use "mark_as_used_for_origin_circuit" where we doNick Mathewson
Also, explain why it's relevant for bootstrapping. This is a comments-only patch.
2020-10-13Make "usecreatefast" always-off.Nick Mathewson
Part of #40139, where I'm removing network parameters that we shouldn't be looking at any longer.
2020-09-18Add flag for whether an OR conn "counts" for bootstrap trackingNick Mathewson
We set this flag if we've launched the connection in order to satisfy an origin circuit, or when we decide the connection _would_ satisfy an origin circuit. These are the only or_connections we want to consider for bootstrapping: other or_connections are opened because of client EXTEND requests, and they may succeed or fail because of the clients' confusion or misconfiguration. Closes #25061.
2020-08-14Revise trac.torproject.org urls to refer to gitlab replacements.Nick Mathewson
Closes #40101.
2020-08-12Merge branch 'maint-0.4.4'George Kadianakis
2020-08-03Merge branch 'ticket40081_035' into ticket40081_044Nick Mathewson
Resolves conflicts: src/core/or/channel.c src/test/test_channel.c
2020-08-03Remove channel_is_canonical_is_reliable()Nick Mathewson
This function once served to let circuits continue to be built over version-1 link connections. But such connections are long-obsolete, and it's time to remove this check. Closes #40081.
2020-07-16Collapse channel_get_*_remote_addr() into a single function.Nick Mathewson
Since we can list the real address and the canonical one in a human-readable format we don't need to pick.
2020-07-14Merge branch 'ticket40033_045_01_squashed'Nick Mathewson
2020-07-14Rename blacklist and whitelist wordingDavid Goulet
Closes #40033 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Helper macro to disambiguate identifiersDavid Goulet
In order to disambiguate the subsystem and event_name identifiers in the tor_trace() macro, add TR_SUBSYS() and TR_EV() which help to identify the parameters of tor_trace() explicitly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Add two origin circuit specific tracepointsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Add four more circuit subsystem tracepointsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-02Clean up a redundant debug log in circuit_handle_first_hop().Nick Mathewson
We don't need to log that we're about to look for a channel for a given extend_info_t, since we're either going to log that we're launching one (at info), or that we're using an existing one (at debug).
2020-07-02Allow multiple addresses in extend_info_t.Nick Mathewson
In practice, there will be at most one ipv4 address and ipv6 address for now, but this code is designed to not care which address is which until forced to do so. This patch does not yet actually create extend_info_t objects with multiple addresses. Closes #34069.
2020-07-02Refactor channel_connect_for_circuit() to take an extend_info_t.Nick Mathewson
2020-07-02Extract extend_info manipulation functions into a new file.Nick Mathewson
2020-06-30Refactor reachability test logging: log exactly what we launch.Nick Mathewson
Previously we had two chains of logic for reachability tests: one for launching them, and one for telling the user that we had launched them. Now, we simply have the launch code inform the user: this way, we can't get out of sync. Closes ticket 34137.
2020-06-24Rename router_should_skip_orport_reachability_check.Nick Mathewson
This was supposed to happen in #40012, but the command line was wrong. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ router_should_skip_orport_reachability_check router_all_orports_seem_reachable
2020-06-09Merge remote-tracking branch 'tor-github/pr/1888/head'Nick Mathewson
2020-05-18circuitbuild: Do node checks when counting nodesteor
Use the node check function to check that there are enough nodes to select a circuit path. Adds these checks, which are implied by other code: * supports EXTEND2 cells, * does not allow single-hop exits, Adds these extra checks: * has a general-purpose routerinfo, * if it is a direct connection, check reachable addresses. These checks reduce the node count, but they will never under-count nodes. Bridge nodes aren't handled correctly, we'll fix that in the next commit. Part of 34200.
2020-05-18circuitbuild: Do node checks when choosing exitsteor
And check that the correct flags are passed when choosing exits. Adds the following checks for exits: * must support EXTEND2 cells, * must have an ntor circuit crypto key, * can't require the guard flag, * can't be a direct connection. All these checks are already implied by other code. Part of 34200.
2020-05-18nodelist: Move node flag checksteor
Move node flag checks to router_add_running_nodes_to_smartlist(), where they are actually used. Part of 34200.
2020-05-18nodelist: Move the v3 onion service rendezvous checkteor
And delete a loop that is now empty. This change should improve tor's performance, because we no longer iterate through the nodelist twice for every node in every circuit path. Part of 34200.
2020-05-14circuitbuild: Refactor IPv6 extend node selectionteor
Move this complex check into its own function. Part of 33222.
2020-05-14circuitbuild: Refactor build state node selection flagsteor
Move common build state to node selection flags conversion code into its own function. Part of 33222.
2020-05-11routerlist: Choose nodes that can initiate IPv6 extendsteor
Part of 33226.
2020-05-11circuit: Add flags for IPv6 extendsteor
But don't implement the actual node selection yet. Part of 33226.
2020-05-07Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ router_skip_orport_reachability_check router_should_skip_orport_reachability_check \ router_skip_dirport_reachability_check router_should_skip_dirport_reachability_check \ router_connect_assume_or_reachable client_or_conn_should_skip_reachable_address_check \ router_connect_assume_dir_reachable client_dir_conn_should_skip_reachable_address_check It was generated with --no-verify, so it probably breaks some commit hooks. The commiter should be sure to fix them up in a subsequent commit.
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
Amazingly, this time we had no merge conflicts with "falls through" comments.
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.3 version.)
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2020-04-30circuitbuild: Allow relays to send IPv6 extend cellsteor
Allow relays and bridges to send IPv4 or IPv6 extend cells. But keep restricting clients to IPv4 extend cells, because sending IPv6 extend cells would be an obvious version distinguisher. Part of 33222.
2020-04-30relay: Wrap long linesteor
Part of 33222.
2020-04-30relay: Clarify reachability status check functionsteor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ check_whether_orport_reachable router_skip_orport_reachability_check \ check_whether_dirport_reachable router_skip_dirport_reachability_check It was generated with --no-verify, so it probably breaks some commit hooks. The commiter should be sure to fix them up in a subsequent commit. Part of 33222.
2020-04-29relay/circuitbuild: Re-use IPv6 connections for circuitsteor
Search for existing connections using the remote IPv4 and IPv6 addresses. Part of 33817.
2020-04-09core/or: Make some functions mockableteor
Preparation for testing circuit_extend(). Part of 33633.
2020-04-09circuitbuild: Make some functions mockableteor
Part of 33633.
2020-03-20relay: Split out relay-only circuit buildingteor
Move the relay-only circuit building functions into a new file. Part of 33633.
2020-03-20relay: Move inform_testing_rechability() to relayteor
Move inform_testing_rechability() to the relay module, and disable it when the relay module is disabled. Part of 33633.
2020-01-28Write unittest that covers cases of INTRODUCE1 handling.George Kadianakis
Also fix some memleaks of other OB unittests.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-10-26Rename confparse.[ch] identifiers to confmgt.[ch] identifiers.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ confparse.h confmgt.h \ confparse.c confmgt.c \ CONFPARSE_PRIVATE CONFMGT_PRIVATE \ TOR_CONFPARSE_H TOR_CONFMGT_H
2019-09-11Update #includes to point to confparse.h in its new location.Nick Mathewson
This commit was automatically generated by running scripts/maint/rectify_include_paths.py .
2019-06-11Rework origin circuit tracking to use pubsubTaylor Yu
Part of ticket 29976.
2019-05-08Merge branch 'tor-github/pr/1000'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Hiding crypt_path_t: Move some more crypt_path-specific functions.George Kadianakis
- Move test-only cpath_get_n_hops() to crypt_path.c. - Move onion_next_hop_in_cpath() and rename to cpath_get_next_non_open_hop(). The latter function was directly accessing cpath->state, and it's a first step at hiding ->state.
2019-05-03Hiding crypt_path_t: Rename some functions to fit the crypt_path API.George Kadianakis
Some of these functions are now public and cpath-specific so their name should signify the fact they are part of the cpath module: assert_cpath_layer_ok -> cpath_assert_layer_ok assert_cpath_ok -> cpath_assert_ok onion_append_hop -> cpath_append_hop circuit_init_cpath_crypto -> cpath_init_circuit_crypto circuit_free_cpath_node -> cpath_free onion_append_to_cpath -> cpath_extend_linked_list
2019-05-03Hiding crypt_path_t: Move some more init funcs in crypt_path.c.George Kadianakis
Everything is moved, but the argument of the function is edited to access ->private->crypto.