summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10Add an extra comment about keeping rust and c protover in sync.Nick Mathewson
2020-07-10Merge remote-tracking branch 'tor-gitlab/mr/42'Nick Mathewson
2020-07-10Merge remote-tracking branch 'tor-gitlab/mr/41'Nick Mathewson
2020-07-10Merge branch 'tor-gitlab/mr/39'David Goulet
2020-07-10addr: Remove BUG() that always triggersDavid Goulet
Fix on unreleased code. Logical || in the BUG() made it that it would always trigger the BUG(). Fixes #40034 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10addr: Remove a BUG() that can normally occurDavid Goulet
Fix on unreleased code. The relay_new_address_suggestion() is called when a NETINFO cell is received thus not only for relay or bridges. Remove the BUG() that made sure only in server mode we could handle the suggested address. Fixes #40032 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10Merge remote-tracking branch 'tor-gitlab/mr/29'Nick Mathewson
2020-07-10connstats: use correct formatter for uint32_t.Nick Mathewson
We have had no reports of negative counts here, so it is probably safe not to backport this.
2020-07-10Collect IPv6 bidi connection statisticsNick Mathewson
2020-07-10connstats: extract functions for summarizing a connection's statusNick Mathewson
2020-07-10connstats: extract connection type counts into a structure.Nick Mathewson
2020-07-10connstats: add and clarify some documentation.Nick Mathewson
2020-07-10Change connstats.c identifers to start with conn_statsNick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ rep_hist_conn_stats_init conn_stats_init \ rep_hist_note_or_conn_bytes conn_stats_note_or_conn_bytes \ rep_hist_reset_conn_stats conn_stats_reset \ rep_hist_format_conn_stats conn_stats_format \ rep_hist_conn_stats_write conn_stats_save \ rep_hist_conn_stats_term conn_stats_terminate \ bidi_map_free_all conn_stats_free_all
2020-07-10Split bidi connection-stats code into a new C file.Nick Mathewson
2020-07-10Record IPv6 bandwidth history as appropriate.Nick Mathewson
2020-07-10Make channel_get_addr_if_possible() take a const channel_t.Nick Mathewson
(There is no reason that looking up the address of a channel should ever change it.)
2020-07-10Add IPv6 read and write history to bwhist, state, and extrainfo.Nick Mathewson
These values are stored, persisted, and published. They are not yet actually filled with anything.
2020-07-10Refactor bwhist_get_bandwidth_lines()Nick Mathewson
We've done a lot to improve our internal APIs since we wrote this code, and it shows. We can just use a buf_t to build up the bandwidth lines, and save a bunch of stack fiddling. Additionally, we can use a function to format a single line, and thereby get rid of the cheezy pattern that does for (i=0;i<n;++i) { switch (i) { ... } ... }
2020-07-10Rename private bandwidth-history identifiers to start with "bwhist".Nick Mathewson
This commit is a simple search-and-replace in bwhist.c
2020-07-10Rename public bandwidth-history identifiers to start with "bwhist".Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ rep_hist_note_bytes_read bwhist_note_bytes_read \ rep_hist_note_bytes_written bwhist_note_bytes_written \ rep_hist_note_dir_bytes_read bwhist_note_dir_bytes_read \ rep_hist_note_dir_bytes_written bwhist_note_dir_bytes_written \ rep_hist_get_bandwidth_lines bwhist_get_bandwidth_lines \ rep_hist_update_state bwhist_update_state \ rep_hist_load_state bwhist_load_state \ rep_hist_bandwidth_assess bwhist_bandwidth_assess
2020-07-10Split bandwidth history functions into a separate C file.Nick Mathewson
These are logically independent from the rest of rephist, and make more sense in isolation. The next patch will rename them too.
2020-07-09Merge remote-tracking branch 'tor-gitlab/mr/36'Nick Mathewson
2020-07-09Merge remote-tracking branch 'tor-gitlab/mr/21'Nick Mathewson
2020-07-09test: Add IPv6 inet_pton double "::" testDavid Goulet
Unclear but that somehow failed on Windows once (?) according to ticket #33768 but we are not seeing that failure. Nevertheless, add a simple unit test. Closes #33768 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-09addr: Static assert resolved address cache sizeDavid Goulet
This will make sure that we always properly initialize the cache by the exact size all the time. Related to #40022 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-09Merge branch 'maint-0.4.4'George Kadianakis
2020-07-09Merge branch 'tor-github/pr/1989' into maint-0.4.4George Kadianakis
2020-07-09Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-09Merge remote-tracking branch 'dgoulet/ticket33796_044_01' into maint-0.4.4Nick Mathewson
2020-07-09Merge branch 'maint-0.4.4'Nick Mathewson
2020-07-09Merge branch 'maint-0.4.3' into maint-0.4.4Nick Mathewson
2020-07-09Merge branch 'maint-0.4.2' into maint-0.4.3Nick Mathewson
2020-07-09Merge branch 'maint-0.3.5' into maint-0.4.2Nick Mathewson
2020-07-09Merge branch 'trove_2020_001_035' into maint-0.3.5Nick Mathewson
2020-07-09hs-v3: Remove a possible BUG() conditionDavid Goulet
When receiving an introduction NACK, the client either decides to close or re-extend the circuit to another intro point. In order to do this, the service descriptor needs to exists but it is possible that it gets removed from the cache between the establishement of the introduction circuit and the reception of the (N)ACK. For that reason, the BUG(desc == NULL) is removed because it is a possible normal use case. Tor recovers gracefully already. Fixes #34087 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-09Merge branch 'maint-0.4.4'David Goulet
2020-07-09Merge branch 'tor-github/pr/1988' into maint-0.4.4David Goulet
2020-07-09Merge branch 'maint-0.4.4'David Goulet
2020-07-09Refactor setup_intro_circ_auth_key() to make it simpler.George Kadianakis
It now uses the 'goto err' pattern, instead of the fatal_unreached() pattern. The latter pattern is usually used when there is a loop, but there is no loop in this function so it can be simplified easily.
2020-07-09Handle a failure edge-case when a client-side intro circ opens.George Kadianakis
2020-07-08socks: Returns 0xF6 only if BAD_HOSTNAMEGuinness
This commit modifies the behavior of `parse_extended_address` in such a way that if it fails, it will always return a `BAD_HOSTNAME` value, which is then used to return the 0xF6 extended error code. This way, in any case that is not a valid v2 address, we return the 0xF6 error code, which is the expected behavior. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Emit a warning if tracing is built inDavid Goulet
Built in tracing should _not_ be run if it was not set on purpose. Warn as loud as we can in order to inform the user that they are running a version with tracing capabilities built in. This commit also adds a subsys stub because utlimately the logging will happen in the init phase but because the default log file is not set in the sys_logging init function, the stub is not useful for now. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Helper macro to disambiguate identifiersDavid Goulet
In order to disambiguate the subsystem and event_name identifiers in the tor_trace() macro, add TR_SUBSYS() and TR_EV() which help to identify the parameters of tor_trace() explicitly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Move LTTng specific declartion to .inc fileDavid Goulet
LTTng tracepoint probe declaration is not really following a C standard that coccinelle and checkSpace.pl likes. Move everything to a .inc file and standardize the trace_probes_circuit.h header to include that LTTng specific file if the instrumentation was enabled at configure time. Part of #32910 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Only build probes if instrumentation is enabledDavid Goulet
For now, trace_probes_circuit.c only contains LTTng probes so build it only if enabled within in the build system _and_ the code. Also, ignore trace_probes_circuit.h for coccinelle parsing. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Comments and improve doc/HACKING/Tracing.mdDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Add two circuit tracepoints for new circuitsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Add two origin circuit specific tracepointsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08trace: Add four generic circuit tracepointsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>