aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/selftest.c
AgeCommit message (Collapse)Author
2022-02-22Extend info argument updates for non-ntorv3 casesMike Perry
2022-02-22Use protover to signal support for ntor3 + congestion control.Nick Mathewson
2022-01-19relay: Fix memory leak on BUG() code pathDavid Goulet
Introduced in bf10206e9e23ac0ded2cc9727666696ea25d5636 which is not released yet thus no changes file. Found by Coverity with cid #1495786. Fixes #40532 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-12-15Fix compiler warnings from ubuntu/jammyDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-02-23Merge branch 'ticket40282_046_01_squashed'Nick Mathewson
2021-02-22Merge branch 'maint-0.4.5'Alexander Færøy
2021-02-22relay: Remove dirport reachability self testDavid Goulet
Regular relays are about to get their DirPort removed so that reachability test is not useful anymore Authorities will still use the DirPort but because network reentry towards their DirPort is now denied network wide, this test is not useful anymore and so it should simply be considered reachable at all time. Part of #40282 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs-v2: Removal of service and relay supportDavid Goulet
This is unfortunately massive but both functionalities were extremely intertwined and it would have required us to actually change the HSv2 code in order to be able to split this into multiple commits. After this commit, there are still artefacts of v2 in the code but there is no more support for service, intro point and HSDir. The v2 support for rendezvous circuit is still available since that code is the same for the v3 and we will leave it in so if a client is able to rendezvous on v2 then it can still transfer traffic. Once the entire network has moved away from v2, we can remove v2 rendezvous point support. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-17relay: No longer test dirport reachability for authoritiesRoger Dingledine
Now that exit relays don't allow exit connections to directory authority DirPorts, the follow-up step is to make directory authorities stop doing DirPort reachability checks. Fixes #40287 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-01-10fix typos and whitespaceRoger Dingledine
2020-12-08relay: Avoid log reachability test for bandwidth test circuitDavid Goulet
Fixes #40205 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-08-11Only log port self-testing message when we are _starting_ to test.Nick Mathewson
(Unlike approaches in earlier versions of Tor, this one logs if and only if we are launching a test, and we haven't said that we're testing this port.) Fixes bug 40068; bug not in any released version. Closes #40068.
2020-07-24relay: Publish IPv4 descriptor on guessed IPv6 reachability failureDavid Goulet
On an IPv6 reachability failure test, if the address was configured, don't publish the descriptor and log warn. If the address was auto discovered, still publish the descriptor. Closes #33247. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
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-02Extract extend_info manipulation functions into a new file.Nick Mathewson
2020-07-01Add a comment explaining reachability vs bandwidth self-testsNick Mathewson
This is in response to a question about why we don't always log orport self-tests as reachability tests. I'm not 100% convinced that bandwidth self-tests are still useful, but that's an issue for another day. :)
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-26Merge branch 'assume_reachable_revamp'Nick Mathewson
2020-06-24Add an AssumeReachableIPv6 autobool option.Nick Mathewson
This option tells Tor that our IPv6 orport is reachable, and doesn't need to be checked. Closes the rest of 33224.
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-24Add a control event for launching IPv6 ORPort checks.Nick Mathewson
2020-06-24Replace router_should_skip_*() identifiers.Nick Mathewson
These identifiers are confusing and unreadable. I think these replacements should be better. Closes ticket #40012. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ router_should_skip_orport_reachability_check_family router_orport_seems_reachable \ router_should_skip_dirport_reachability_check router_dirport_seems_reachable \ router_should_skip_dirport_reachability_check router_all_orports_seem_reachable
2020-06-23Clarify logic in router_should_skip_orport_reachability_check_family()Nick Mathewson
The '!=' checks were confusing the issue of what the code was really doing.
2020-06-18Split "can reach ipv4 orport" from "can reach ipv6 orport".Nick Mathewson
I've managed to keep this change mainly contained to our self-testing module. The changes here are: * There are two different variables for tracking "is our orport reachable". * We have a new function that says whether we can skip a single family's orport reachability test; the old function for this now tells whether we can skip _all_ orport reachability testing. (The name, router_should_skip_orport_reachability_test, is not so good. I will rename it later if I can think of a good replacement.) * The function that launches orport reachability tests now only launches the ones that haven't completed. * The function that notes that we're reachable on an ORPort now takes a family. * Various log messages are cleaned up.
2020-06-17selftest: turn can_reach_{dir,or}_port into boolsNick Mathewson
2020-06-09Merge remote-tracking branch 'tor-github/pr/1888/head'Nick Mathewson
2020-05-21Check for NULL from tor_dup_ip()rl1987
2020-05-11circuit: Add flags for IPv6 extendsteor
But don't implement the actual node selection yet. Part of 33226.
2020-05-07relay: Improve docs on inform_testing_reachability()teor
Document race conditions that we'll resolve in 34067 and 34137. Part of 33222.
2020-05-07relay: Rewrite inform_testing_reachability()teor
Rewrite inform_testing_reachability() to use separate buffers for IPv4 ORPort, IPv6 ORPort, and IPv4 DirPort. And use consistent APIs to fill those buffers. Part of 33222.
2020-05-07relay: Clarify a comment in selftest.cteor
2020-05-07routerinfo: Make router_get_orport() return an error statusteor
Part of 33222.
2020-05-07Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ client_or_conn_should_skip_reachable_address_check router_or_conn_should_skip_reachable_address_check \ client_dir_conn_should_skip_reachable_address_check router_dir_conn_should_skip_reachable_address_check
2020-05-07Wrap long linesteor
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-04-30relay: Update some self-test comments for IPv6teor
Part of 33222.
2020-04-30relay: Log IPv4 and IPv6 ORPorts when testing reachabilityteor
When a relay starts testing reachability, log its IPv6 ORPort. The existing code logs the IPv4 ORPort and DirPort. The IPv4 ORPort is required. The other ports are only logged if they are present. Part of 33222.
2020-04-30relay: Launch IPv4 and IPv6 ORPort self-test circuitsteor
When launching relay ORPort reachability self-tests, launch tests to the IPv4 and IPv6 ORPorts (if available). Part of 33222.
2020-04-30relay: Refactor dirport self-test circuit launchteor
Remove some redundant variables, and improve some comments. Explain that there are no advertised IPv6 DirPorts. Part of 33222.
2020-04-30relay: Refactor reachability circuit launchesteor
Split OR and Dir reachability circuits into their own functions. Part of 33222.
2020-04-30relay: Remove unused DirPort self-test codeteor
DIRIND_ANON_DIRPORT never uses our ORPort, so we don't need to set it in the directory request. Part of 33222.
2020-04-30relay: Add an address family to self-test launchesteor
Add an address family argument to the functions that launch relay ORPort self-test circuits. Part of 33222.
2020-04-30relay: Minor selftest comment updatesteor
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-30nodelist: Distinguish client and relay reachabilityteor
Change some function names to distinguish between: * client first hop reachability (ReachableAddresses) * relay port reachability self-tests This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ router_skip_or_reachability router_connect_assume_or_reachable \ router_skip_dir_reachability router_connect_assume_dir_reachable 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-30relay: Fix a comment typo in the selftest.c headerteor
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.