aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/dns.c
AgeCommit message (Collapse)Author
3 daysfix a few comment typosRoger Dingledine
2023-10-18add rate limit on BEGIN and RESOLVE cell per circuittrinity-1686a
2023-04-06Prop#329 streams: Handle stream usage with confluxMike Perry
This adds utility functions to help stream block decisions, as well as cpath layer_hint checks for stream cell acceptance, and syncing stream lists for conflux circuits. These functions are then called throughout the codebase to properly manage conflux streams.
2022-12-16Fix typosDimitris Apostolou
2022-11-09Merge branch 'maint-0.4.7'David Goulet
2022-11-09dns: Make TTLs fuzzy at exit relaysRasmus Dahlberg
This change mitigates DNS-based website oracles by making the time that a domain name is cached uncertain (+- 4 minutes of what's measurable). Resolves TROVE-2021-009. Fixes #40674
2022-11-01Clip DNS TTL values once in event callbackRasmus Dahlberg
This change ensures that other parts of the code base always operate on the same clipped TTL values, notably without being aware of clipping.
2022-06-16Don't add redundant quotes with escaped() in log messages.Nick Mathewson
The escaped() function and its kin already wrap their output in quotes: there's no reason to do so twice. I am _NOT_ making a corresponding change in calls that make the same mistake in controller-related functions, however, due to the risk of a compatibility break. :( Closes #22723.
2022-03-16dns: Remove reachable BUG()David Goulet
Fixes #40587 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-03-15relay: Reconfigure libevent options only on DNS params changeDavid Goulet
Related #40312 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-03-15relay: On new consensus, reconfigure DNS nameserversDavid Goulet
This applies only for relays. Previous commit adds two new consensus parameters that dictate how libevent is configured with DNS resolution. And so, with a new consensus, we now look at those values in case they ever change. Without this, Exit relay would have to HUP or restart to apply any new Exit DNS consensus parameters. Related to #40312 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-03-15relay: Lower DNS Exit-side timeoutDavid Goulet
Introduces two new consensus parameter: exit_dns_timeout: Number of seconds before libevent should consider the DNS request a timeout. exit_dns_num_attempts: Number of attempts that libeven should retry a previously failing query before calling it a timeout. Closes #40312 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-14dns: Do not trigger overload general on DNS timeoutDavid Goulet
This was missed in #40527 when the DNS timeout overload general signal was removed. Closes #40564 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-12dns: Gather DNS request statisticsDavid Goulet
We now keep track of all errors and total number of request seen. This is so we can expose those values to the MetricsPort to help Exit operators monitor the DNS requests and failures. Related to #40367. Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-05-10Remove unused function: dns_randfn_() in dns.c.Alexander Færøy
This patch unbreaks the current build after tor!369 landed. See: https://bugs.torproject.org/tpo/core/tor/40371
2021-05-10Merge remote-tracking branch 'tor-gitlab/mr/369'Alexander Færøy
2021-04-16Stop calling evdns_set_random_bytes_fn()Nick Mathewson
This function has been a no-op since Libevent 2.0.4-alpha, when libevent got an arc4random() implementation. Libevent has finally removed it, which will break our compilation unless we stop calling it. (This is currently breaking compilation in OSS-fuzz.) Closes #40371.
2021-03-17Merge branch 'mr/334'George Kadianakis
2021-03-17Implement straightforward overload general metrics.George Kadianakis
- OOM metric - onionskin overload metric - DNS timeout metric
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
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-06-05Fix some checks of tor_inet_ntoa() return valuerl1987
Also, fix a format string.
2020-05-21Check output value of tor_inet_ntop/tor_inet_ntoa in dns.crl1987
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;
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-03-05Merge remote-tracking branch 'tor-github/pr/1772/head'Nick Mathewson
2020-03-05Merge branch 'clang_format_prep_3'Nick Mathewson
2020-02-26Correct spacing in dns_launch_correctness_checks()Neel Chauhan
2020-02-19Make dns_cancel_pending_resolve() STATIC.Nick Mathewson
It is not called by anything outside of the tests and dns.c.
2020-02-19Remove assert_all_pending_dns_resolves_ok().Nick Mathewson
It hasn't been used since 2009.
2020-02-18Move DNS TTL manipulation code to src/core/orNick Mathewson
This removes a dependency from the client code on feature/relay.
2020-02-18Replace identifiers related to clipping DNS ttls.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ MIN_DNS_TTL_AT_EXIT MIN_DNS_TTL \ MAX_DNS_TTL_AT_EXIT MAX_DNS_TTL \ dns_clip_ttl clip_dns_ttl
2020-02-10Use semicolons after HT_PROTOTYPE and HT_GENERATE.Nick Mathewson
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-23Merge branch 'tor-github/pr/1034'David Goulet
2019-05-17OOM-purge the DNS cache one part at a timeNick Mathewson
Previously we purged it in 1-hour increments -- but one-hour is the maximum TTL for the cache! Now we do it in 25%-TTL increments. Fixes bug 29617; bugfix on 0.3.5.1-alpha.
2019-03-25Split all controller events code into a new control_events.cNick Mathewson
Also, split the formatting code shared by control.c and control_events.c into controller_fmt.c.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-03Merge branch 'maint-0.3.5'Nick Mathewson
2018-12-17Check hostname before using it in send_resolved_hostname_cell()Nick Mathewson
Also, turn an absent hostname into a BUG(), not a crash. Found by scan-build. Closes ticket 28879; bugfix on 0.1.2.7-alpha
2018-10-31Fix memory leak (#28257, CID 1440805).Nick Mathewson
2018-10-26In configured_nameserver_address, check if tor_addr_from_sockaddr succeededrl1987
2018-10-20Exclude test and a supporting function when evdns_base_get_nameserver_addr() ↵rl1987
is not available