- Jun 24, 2020
-
-
Nick Mathewson authored
These parameters do not suppress checks, but they tell relays that it's okay to publish even when those checks fail. I have chosen lowercase hyphenated names, since these seem to be more common in networkstatus params. Closes #33224 and part of #34064.
-
Nick Mathewson authored
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
-
Nick Mathewson authored
The purpose of having this function was to inform other code that the consensus has changed, so it should go there.
-
Nick Mathewson authored
This is part of refactoring our "notify the rest of the code that we have a new consensus" code.
-
David Goulet authored
-
David Goulet authored
Better function name. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Instead of a complex if/else block, use a table of functions that have the same interface and each of them attempt to find the address one after the other. Pointed out by nickm's during review. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
By doing this, a memory leak was found with "hostname_used" that could have been overwritten by another function. This commit changes that by making it a NULL string instead. Found by nickm's review. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
The last resolved address cache uses an index that is mapped to an address family (AF_INET and AF_INET6). This commit adds a conversion function from af to index and change the code to use that all the time only. In the process, this commit fixes a bug that the last resolved address accessors were using the af value insted of the index. Spotted by nickm during review Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Replace it by find_my_address() everywhere. This changes many parts of the code that uses it to use a tor_addr_t instead of a plain uint32_t for IPv4. Many changes to the unit test to also use the new interface. Part #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Series of changes: 1. Rename function to reflect the namespace of the file. 2. Use the new last resolved cache instead of the unused last_resolved_addr_v4 (which is also removed in this commit). 3. Make the entire code base use the new resolved_addr_is_local() function. You will notice that this function uses /24 to differentiate subnets where the rest of tor uses /16 (including documentation of EnforceDistinctSubnets). Ticket #40009 has been opened for that. But that the moment, the function keeps looking at /24. Part of #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Series of things done in this commit: 1. Rename the functions to better reflect the namespace of the file. 2. Make both reset and get function to operate on the last_resolved_addrs cache that is per family. 3. Make the get function to take a tor_addr_t. 4. Change all callsite to use the new convention. Part of #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
In order to transition smoothly, maek resolve_my_address_v4() call the new fancy find_my_address() with AF_INET. Next commits should remove the use of resolve_my_address_v4() accross the code to use find_my_address(). This commit is so the unit tests would be more easily fixed and port to the new find_my_address() internals. Part of #33233. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
resolve_my_address() was beyond repair in terms of refactoring. Way too complex and doing too many things. This commit implements find_my_address() which in theory does the same as resolve_my_address() but in a more clean, concise and modern way using the tor_addr_t interface and for multiple address family. The caller needs to pass the address family (IPv4 or IPv6) which this interface supports. For both, a last resolved cache is used as well. Implements #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
-
Nick Mathewson authored
-
-
-
-
Nick Mathewson authored
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
-
David Goulet authored
-
David Goulet authored
The buf_read_from_tls() function was designed to read up to a certain number of bytes a TLS socket using read_to_chunk_tls() which boils down to SSL_read() (with OpenSSL, common case). However, at the end of the loop, the returned number of bytes from read_to_chunk_tls() was treated like the syscall read() for which if less bytes than the total asked are returned, it signals EOF. But, with SSL_read(), it returns up to a TLS record which can be less than what was asked. The assumption that it was EOF was wrong which made the while loop exiting before it was able to consume all requested bytes (at_most parameter). The general use case that Tor sees is that it will ask the network layer to give it at most 16KB (that is roughly 32 cells) but because of KIST scheduler, the highest possible TLS record we currently observe is 4096 bytes (4KB or 8 cells). Thus the loop would at best always return 8 cells even though much more could be on the TLS socket. See ticket #40006 for more details. Fixes #40006 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
George Kadianakis authored
-
Neel Chauhan authored
-
George Kadianakis authored
-
David Goulet authored
-
- Jun 23, 2020
-
-
George Kadianakis authored
-
Mike Perry authored
Needed to satisfy practracker.
-
Mike Perry authored
-
Mike Perry authored
-
Nick Mathewson authored
-
Nick Mathewson authored
-
Nick Mathewson authored
The '!=' checks were confusing the issue of what the code was really doing.
-
Nick Mathewson authored
Since "skip orport check" is the "and" of v4_ok and v6_ok, we can just compute v4_ok and v6_ok once, to clarify that we don't enter this block of code if they're both true.
-
David Goulet authored
Part of #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
Part of #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
With prop312, we want to support IPv4 and IPv6 thus multiple Address statement (up to 2) will be accepted. For this, "Address" option becomes a LINELIST so we can properly process the IPv4 or/and IPv6. Part of #33233 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
-