Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket33029 043 02 #1691

Closed
wants to merge 9 commits into from
Closed

Conversation

Labels
None yet
Projects
None yet
5 participants
@dgoulet-tor
Copy link
Contributor

@dgoulet-tor dgoulet-tor commented Jan 28, 2020

No description provided.

@coveralls
Copy link

@coveralls coveralls commented Jan 28, 2020

Pull Request Test Coverage Report for Build 7922

  • 39 of 44 (88.64%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 63.419%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/core/mainloop/connection.c 5 6 83.33%
src/feature/dircache/dircache.c 5 6 83.33%
src/feature/nodelist/nodelist.c 14 17 82.35%
Totals Coverage Status
Change from base Build 7892: 0.04%
Covered Lines: 50031
Relevant Lines: 78890

💛 - Coveralls

Copy link

@armadev armadev left a comment

In the commit message, s/seperate/separate/ and s/addresse/address/

@dgoulet-tor dgoulet-tor force-pushed the ticket33029_043_02 branch 2 times, most recently from 1475457 to 225dedb Jan 28, 2020
!the_nodelist || !the_nodelist->node_addrs) {
return;
}
address_set_add(the_nodelist->node_addrs, addr);
Copy link
Contributor

@teor2345 teor2345 Jan 29, 2020

Your code will be slightly shorter if you do this check here:

Suggested change
address_set_add(the_nodelist->node_addrs, addr);
if (!tor_addr_is_null(addr))
address_set_add(the_nodelist->node_addrs, addr);

if (!the_nodelist || !the_nodelist->node_addrs) {
return;
}
address_set_add_ipv4h(the_nodelist->node_addrs, addr);
Copy link
Contributor

@teor2345 teor2345 Jan 29, 2020

Your code will be slightly shorter if you do this check here:

Suggested change
address_set_add_ipv4h(the_nodelist->node_addrs, addr);
if (addr)
address_set_add_ipv4h(the_nodelist->node_addrs, addr);

@dgoulet-tor dgoulet-tor force-pushed the ticket33029_043_02 branch 2 times, most recently from cd539df to 8373232 Jan 29, 2020
dgoulet-tor added 8 commits Jan 30, 2020
That function is only used to test the global bucket write limit for a
directory connection.

It should _not_ be used for anything else since that function looks to see if
we are a directory authority.

Rename it to something more meaningful. No change in behavior at this commit,
only renaming.

Part of #33029

Signed-off-by: David Goulet <dgoulet@torproject.org>
…_low()

Signed-off-by: David Goulet <dgoulet@torproject.org>
Signed-off-by: David Goulet <dgoulet@torproject.org>
We separate v4 and v6 because we often use an IPv4 address represented with
a uint32_t instead of a tor_addr_t.

This will be used to also add the trusted directory addresses taken from the
configuration.

The trusted directories from the consensus are already added to the address
set from their descriptor.

Signed-off-by: David Goulet <dgoulet@torproject.org>
The configured, within the torrc or hardcoded, directory authorities addresses
are now added to the nodelist address set.

Signed-off-by: David Goulet <dgoulet@torproject.org>
Authorities were never sending back 503 error code because by design they
should be able to always answer directory requests regardless of bandwidth
capacity.

However, that recently backfired because of a large number of requests from
unknown source using the DirPort that are _not_ getting their 503 code which
overloaded the DirPort leading to the authority to be unable to answer to its
fellow authorities.

This is not a complete solution to the problem but it will help ease off the
load on the authority side by sending back 503 codes *unless* the connection
is from a known relay or an authority.

Fixes #33029

Signed-off-by: David Goulet <dgoulet@torproject.org>
This controls the previous feature added that makes dirauth send back a 503
error code on non relay connections if under bandwidth pressure.

Signed-off-by: David Goulet <dgoulet@torproject.org>
Part of #33029

Signed-off-by: David Goulet <dgoulet@torproject.org>
@dgoulet-tor dgoulet-tor force-pushed the ticket33029_043_02 branch from f48c9d8 to b9ec1b4 Jan 30, 2020
Signed-off-by: David Goulet <dgoulet@torproject.org>
@torproject-pusher torproject-pusher deleted the branch torproject:master May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment