summaryrefslogtreecommitdiff
path: root/src/feature/relay
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-08-12Merge remote-tracking branch 'tor-gitlab/mr/107' into maint-0.4.4George Kadianakis
2020-08-04Merge branch 'bug40083_035' into bug40083_042Nick Mathewson
Fixes conflicts due to code movement.
2020-08-03Merge remote-tracking branch 'tor-gitlab/mr/79' into maint-0.4.4George Kadianakis
2020-07-22Treat all extorport connections with un-set addresses as remoteNick Mathewson
Without this fix, if an PT forgets to send a USERADDR command, that results in a connection getting treated as local for the purposes of rate-limiting. If the PT _does_ use USERADDR, we still believe it. Closes ticket 33747.
2020-06-05Fix some checks of tor_inet_ntoa() return valuerl1987
Also, fix a format string.
2020-05-21Check for NULL from tor_dup_ip()rl1987
2020-05-21Check output value of tor_inet_ntop/tor_inet_ntoa in dns.crl1987
2020-05-07Merge remote-tracking branch 'tor-github/pr/1880/head'Nick Mathewson
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; (In order to avoid conflicts, I'm applying this script separately to each maint branch. This is the 0.4.2 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-05-06Merge branch 'maint-0.4.1' into maint-0.4.2Nick Mathewson
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
2020-05-06Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-05-06Merge branch 'bug34078_prelim_035' into bug34078_prelim_041Nick Mathewson
2020-05-06Replace some "fall through" comments not at the end of a case.Nick Mathewson
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: Fix a comment typo in the selftest.c headerteor
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-30relay: Refactor extend address validity functionteor
Rename the function, and give it a boolean return value. No behaviour change. Part of 33817.
2020-04-29relay: Refactor choosing extend IPsteor
Flatten the logic in circuit_choose_ip_ap_for_extend(). Part of 33817.
2020-04-29relay: Refactor circuit_open_connection_for_extend()teor
Refactor circuit_open_connection_for_extend(), splitting out the IP address choice code into a new function. Adds unit tests. No behaviour changes in tor. 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-29relay/circuitbuild: Refactor open connection for extendteor
Re-use the newly created extend_info to launch the connection in circuit_open_connection_for_extend(). No behaviour change. Part of 33817.
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-29relay/circuitbuild: Report IPv6 addresses in a debug logteor
Part of 33817.
2020-04-29relay/circuitbuild: Consider IPv6-only extends validteor
Allow extend cells with IPv6-only link specifiers. Warn and fail if both IPv4 and IPv6 are invalid. Also warn if the IPv4 or IPv6 addresses are unexpectedly internal, but continue with the valid address. Part of 33817.
2020-04-29relay: Log the address in circuit protocol warningsteor
Always log the address family in extend protocol warnings. If SafeLogging is 0, also log the address and port. Diagnostics for 33817.
2020-04-29relay: Refactor address checks into a functionteor
No behaviour change. Part of 33817.
2020-04-29relay: Refactor address and port checksteor
tor_addr_port_is_valid_ap(ap, 0) checks if the address or port are zero, exactly like the previous code. Preparation for 33817.
2020-04-12Fix typo in router_build_fresh_unsigned_routerinfo() commentNeel Chauhan
2020-04-09Merge remote-tracking branch 'tor-github/pr/1801/head'Nick Mathewson
2020-04-09relay: Run "make autostyle"teor
But only take the changes from the relay module. Part of 33633.
2020-04-09relay/circuitbuild: Refactor circuit_extend()teor
Make the "else" case explicit at the end of the function. Part of 33633.
2020-04-09relay: End circuitbuild logs with "."teor
Consistent logs make testing easier. Part of 33633.
2020-04-09relay: Check for NULL arguments in circuitbuildteor
Part of 33633.
2020-04-09relay: Make circuitbuild functions STATICteor
Allow the circuitbuild_relay functions to be accessed by the unit tests. Part of 33633.
2020-04-09relay: Remove a redundant function return valueteor
Part of 33633.
2020-04-09relay: Split out opening a connection for an extendteor
Part of 33633.
2020-04-09relay: Refactor some long lines from circuit_extend()teor
Part of 33633.
2020-04-09relay: Split link specifier checks from circuit_extend()teor
Part of 33633.
2020-04-09relay: Split state checks out of circuit_extend()teor
Part of 33633.
2020-04-09relay: Improve the comments on onionskin_answer()teor
Part of 33633.
2020-04-09relay: Protocol warn when a client gets an extendteor
circuit_extend() may be called when a client receives an extend cell, even if the relay module is disabled. Log a protocol warning when the relay module is disabled. Part of 33633.
2020-04-07Merge branch 'pr1838_squashed'teor