summaryrefslogtreecommitdiff
path: root/src/feature/relay/router.c
AgeCommit message (Collapse)Author
2020-09-22Fix warnings when using two unusual options together.Nick Mathewson
The option `--enable-all-bugs-are-fatal` when used with `--disable-module-relay` caused GCC to warn about functions that it thought should be labeled noreturn. I've tried a couple of approaches, but disabling the warning on these functions seems to be the best approach. Fixed #40129; bugfix on 0.4.4.1-alpha.
2020-05-21Check for NULL from tor_dup_ip()rl1987
2020-05-05relay: Rename relay_resolve_addr.{c|h} fileDavid Goulet
New name is more accurate semantically. Closes #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-05config: New file resolve_addr.{c|h}David Goulet
Move a series of function from config.c into that new file which is related to address resolving. Part of #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-05-05relay: New file relay_resolve_addr.{c|h}David Goulet
This commit moves router_pick_published_address() and the related helper functions into the new file. The log_addr_has_changed() function has been made public in router.h so we can use it in relay_resolve_addr.c. This is a refactoring as part of Sponsor 55. Only code movement at this commit. Part of #33789 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-30relay: Refactor can extend over IPv6 checksteor
Split "can extend over IPv6" and "has advertised IPv6 ORPort" into separate functions. They currently have the same result, but this may change in 33818 with ExtendAllowIPv6Addresses. Part of 33817.
2020-04-29relay: Add IP version tests for circuit extendsteor
Add IPv4-only and IPv6-only tests for circuit_open_connection_for_extend(). Part of 33817.
2020-04-29relay: Choose between IPv4 and IPv6 extends at randomteor
When an EXTEND2 cell has an IPv4 and an IPv6 address, choose one of them uniformly at random. Part of 33817.
2020-04-12Fix typo in router_build_fresh_unsigned_routerinfo() commentNeel Chauhan
2020-03-27spell consensus more right in commentsRoger Dingledine
2020-03-21Merge branch 'bug32588_042' into bug32588_043teor
Merge static function declaration deletions from bug32588_042 and maint-0.4.3 in app/config/config.c.
2020-03-21Merge branch 'bug32588_041' into bug32588_042teor
2020-03-21Merge branch 'bug32588_035' into bug32588_041teor
Merge tests from maint-0.4.1 with new tests from bug32588_035 in test_router.c.
2020-03-21router: Refactor IPv6 ORPort function logicteor
Return early when there is no suitable IPv6 ORPort. Show the address and port on error, using a convenience function. Code simplification and refactoring. Cleanup after 32588.
2020-03-21router: Stop advertising incorrect auto IPv6 ORPortsteor
When IPv6 ORPorts are set to "auto", tor relays and bridges would advertise an incorrect port in their descriptor. This may be a low-severity memory safety issue, because the published port number may be derived from uninitialised or out-of-bounds memory reads. Fixes bug 32588; bugfix on 0.2.3.9-alpha.
2020-02-12Merge branch 'maint-0.4.1' into maint-0.4.2teor
2020-02-12Merge branch 'maint-0.3.5' into maint-0.4.1teor
2020-02-12Lowercase the BridgeDistribution value from torrc in descriptors.Alexander Færøy
This patch ensures that we always lowercase the BridgeDistribution from torrc in descriptors before submitting it. See: https://bugs.torproject.org/32753
2020-01-15Don't escape the bridge distribution value.Alexander Færøy
We already check if there are invalid values in check_bridge_distribution_setting() and reject the value if that is the case. We can therefore only have strings of [A-Z] | [a-z] | [0-9] | '-' | '_' here which is according to the directory specification. See: https://bugs.torproject.org/32753
2020-01-15Lowercase BridgeDistribution value before adding it to the descriptor.Alexander Færøy
This patch makes sure we lowercase the value of BridgeDistribution before we add it to the descriptor as `bridge-distribution-request`. See: https://bugs.torproject.org/32753
2020-01-15Always escape BridgeDistribution value from torrc in descriptors.Alexander Færøy
When the BridgeDistribution value was added in commit ebab5215252f9fa810ae091c335c5ae6e619faaf the check for whether the value contains '\n' or '\r' was added as a requirement for whether or not the value should be escaped. This patch removes this check and makes sure we call `escaped()` on the value every time before we add it to a descriptor. See: https://bugs.torproject.org/32753
2020-01-09Merge branch 'ticket22029_attempt_squashed'Nick Mathewson
2020-01-09Allow ed25519 keys to be banned in approved-routersNeel Chauhan
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2020-01-08router: Improve port search function commentsteor
2019-11-07Use new configuration architecture for crypto optionsNick Mathewson
This is a comparatively simple change.
2019-11-05config: Rename new global functions with a prefixteor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ get_dirportfrontpage relay_get_dirportfrontpage \ parse_port_config port_parse_config \ count_real_listeners port_count_real_listeners \ parse_transport_line pt_parse_transport_line \ ensure_bandwidth_cap config_ensure_bandwidth_cap \ get_effective_bwrate relay_get_effective_bwrate \ get_effective_bwburst relay_get_effective_bwburst \ warn_nonlocal_ext_orports port_warn_nonlocal_ext_orports \ parse_ports_relay port_parse_ports_relay \ update_port_set_relay port_update_port_set_relay \ get_transport_bindaddr_from_config pt_get_bindaddr_from_config \ get_options_for_server_transport pt_get_options_for_server_transport It was generated with --no-verify, because it has some long lines. Part of 32213.
2019-10-31config: Move accounting/bandwidth config into the relay moduleteor
This commit: * moves accounting and bandwidth checks into relay_config, * moves testing options checks into relay_config, * moves some other minor checks into relay_config, * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-22Merge remote-tracking branch 'tor-github/pr/1341' into maint-0.4.1Nick Mathewson
2019-10-22Merge remote-tracking branch 'tor-github/pr/1346' into maint-0.4.1Nick Mathewson
2019-10-22Re-run make autostyle.Nick Mathewson
2019-10-20relay: Silence compiler warnings when relay mode is disabledteor
Part of 32123.
2019-09-30Merge branch 'tor-github/pr/1346'George Kadianakis
2019-09-26lock: Avoid some undefined behaviour when freeing mutexes.teor
Fixes bug 31736; bugfix on 0.0.7.
2019-09-25Merge branch 'tor-github/pr/1341'George Kadianakis
2019-09-18Merge branch 'bug30916_035' into bug30916_041Nick Mathewson
2019-09-18Avoid a crash if our "current" and "old" ntor onion keys are equalNick Mathewson
Our dimap code asserts if you try to add the same key twice; this can't happen if everything is running smoothly, but it's possible if you try to start a relay where secret_onion_key_ntor is the same as secret_onion_key_ntor.old. Fixes bug 30916; bugfix on 0.2.4.8-alpha when ntor keys were introduced.
2019-09-18Extract expressions in construct_ntor_key_map()Nick Mathewson
No behavioral change here: this is just refactoring.
2019-06-25stats: add comments about the required chunk structure in extra info filesteor
These comments should prevent future instances of 30958. And allow a larger file in practracker. Follow up after 30958.
2019-06-25Merge branch 'bug30958_041' into bug30958_masterteor
2019-06-24Merge branch 'bug30958_040' into bug30958_041teor
2019-06-24Merge branch 'bug30958_035' into bug30958_040teor
2019-06-24Merge branch 'bug30958_029' into bug30958_035teor
2019-06-24stats: Split extrainfo_dump_to_string() into smaller functions.teor
Closes ticket 30956.
2019-06-24stats: Always publish pluggable transports in extra info documentsteor
Always publish bridge pluggable transport information in the extra info descriptor, even if ExtraInfoStatistics is 0. This information is needed by BridgeDB. Fixes bug 30956; bugfix on 0.4.1.1-alpha.
2019-06-05Run "make autostyle."Nick Mathewson
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-19Merge branch 'maint-0.3.4' into maint-0.3.5teor
2019-04-05crypto_format: Remove the return value from ed25519_signature_to_base64()teor
Also remove all checks for the return value, which were redundant anyway, because the function never failed. Part of 29660.
2019-04-05crypto_format: Remove the return values from digest256_to_base64()teor
... and ed25519_public_to_base64(). Also remove all checks for the return values, which were redundant anyway, because the functions never failed. Part of 29960.