aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/connection_or.c
AgeCommit message (Collapse)Author
2020-07-17or_connection_t: replace real_addr with canonical_orport.Nick Mathewson
Instead of replacing connection_t.{addr,port} with a canonical orport, and tracking the truth in real_addr, we now leave connection_t.addr alone, and put the canonical address in canonical_orport. Closes #40042 Closes #33898
2020-07-16Define new CONST_TO_*_CONN() functions for const-to-const castsNick Mathewson
These names are analogous to the CONST_TO_*_CIRC() functions we have for circuits. Part of #40046.
2020-07-16Improve documentation for our TO_*_CONN() cast functions.Nick Mathewson
Preliminary work for #40046.
2020-07-16Use connection_describe() for log messages.Nick Mathewson
2020-07-14Merge branch 'ticket40033_045_01_squashed'Nick Mathewson
2020-07-14Rename blacklist and whitelist wordingDavid Goulet
Closes #40033 Signed-off-by: David Goulet <dgoulet@torproject.org>
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-02Carry TLS error strings forward to controller when reporting them.Nick Mathewson
Now instead of saying "DONE, DONE" or "MISC, MISC" or "TLS_ERROR, TLS_ERROR", we can finally give a nice sensible "TLS_ERROR, wrong version number" which should help debug a great deal. Closes ticket 32622.
2020-06-26Store errors from TLS write and handshake in the tls_error field.Nick Mathewson
Previously, we would only update this field when the error happened during a read. This will improves our reporting for our bootstrap status, and help to address #32622. The problem is not completely solved by this patch, however: too many errors are still lumped into "MISC".
2020-05-06Merge branch 'maint-0.4.3'Nick Mathewson
2020-05-06connection_or_finished_flushing(): add a missing "break;"Nick Mathewson
This one is harmless like the others (so far)
2020-04-24Merge remote-tracking branch 'tor-github/pr/1862/head'Nick Mathewson
2020-04-14core/or: Update file comment in connection_or.cteor
Fix a typo, and say "v3 (and later) handshake". Comment-only change.
2020-04-14core/or: Accurately log remote relay IPv6 addressesteor
Log IPv6 addresses on connections where this relay is the responder. Previously, responding relays would replace the remote IPv6 address with the IPv4 address from the consensus. (The port is replaced with the IPv6 ORPort from the consensus, we will resolve this issue in 33898.) Fixes bug 33899; bugfix on 0.3.1.1-alpha.
2020-04-14core/or: Allow IPv6 connections to be canonicalteor
Consider IPv6 addresses when checking if a connection is canonical. In 17604, relays assumed that a remote relay could consider an IPv6 connection canonical, but did not set the canonical flag on their side of the connection. Fixes bug 33899; bugfix on 0.3.1.1-alpha.
2020-03-05Merge branch 'clang_format_prep_3'Nick Mathewson
2020-02-20Move relay_handshake.[ch] into src/feature/relay, and make it optionalNick Mathewson
2020-02-19Extract relay-only handshake code into its own file.Nick Mathewson
This is not the only relay-only handshake code, but it is most of such code that is in connection_or.c.
2020-02-18Move ext_orport identifier map into ext_orport.cNick Mathewson
There's no need to move the declarations: those were already in ext_orport.h. This shrinks connection_or.c a little.
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
2020-01-06Merge branch 'haxxpop/tcp_proxy_squashed' into tcp_proxy_squshed_and_mergedNick Mathewson
2020-01-06test: HAPRoxy protocolSuphanat Chunhapanya
2020-01-06circuit: Implement haproxySuphanat Chunhapanya
2019-12-20Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \ TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \ CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \ EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \ SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-06-11Rework orconn tracking to use pubsubTaylor Yu
Part of ticket 29976.
2019-05-01Bug 29231: Report correct padding write totals and enabled totals.Mike Perry
2019-03-27Merge branch 'maint-0.4.0'teor
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-03-25Correctly report PT vs proxy during bootstrapTaylor Yu
Previously, or_connection_t did not record whether or not the connection uses a pluggable transport. Instead, it stored the underlying proxy protocol of the pluggable transport in proxy_type. This made bootstrap reporting treat pluggable transport connections as plain proxy connections. Store a separate bit indicating whether a pluggable transport is in use, and decode this during bootstrap reporting. Fixes bug 28925; bugfix on 0.4.0.1-alpha.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-03Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-03Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2018-12-21Hook up control_event_bootstrap() to btrack_orconnTaylor Yu
Replace a few invocations of control_event_bootstrap() with calls from the bootstrap tracker subsystem. This mostly leaves behavior unchanged. The actual behavior changes come in the next commit. Part of ticket 27167.
2018-12-20Add ORCONN event pubsub systemTaylor Yu
Add a publish-subscribe subsystem to publish messages about changes to OR connections. connection_or_change_state() in connection_or.c and control_event_or_conn_event() in control.c publish messages to this subsystem via helper functions. Move state constants from connection_or.h to orconn_state.h so that subscribers don't have to include all of connection_or.h to take actions based on changes in OR connection state. Move event constants from control.h for similar reasons. Part of ticket 27167.
2018-12-20Remove unused old_state var in connection_or.cTaylor Yu
connection_or_change_state() saved an old_state to pass to channel_tls_handle_state_change_on_orconn(), which promptly cast it to void. Remove this unused variable and parameter.
2018-12-20Merge remote-tracking branch 'tor-github/pr/445'Nick Mathewson
2018-11-14Move buffers.c out of lib/containers to resolve a circularity.Nick Mathewson
2018-10-26Generate NETINFO cell using trunnelrl1987
2018-09-27Extract the non-stats part of geoip into a new src/lib/geoip.Nick Mathewson
2018-09-25Extract all the "am I a server" functions from router.cNick Mathewson
2018-09-25Move all authdir_mode_*() functions into authmode.hNick Mathewson
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-20Split most of dirserv.c into several new modulesNick Mathewson
In dirauth: * bwauth.c reads and uses bandwidth files * guardfraction.c reads and uses the guardfraction file * reachability.c tests relay reachability * recommend_pkg.c handles the recommended-packages lines. * recv_descs.c handles fingerprint files and processing incoming routerinfos that relays upload to us * voteflag.c computes flag thresholds and sets those thresholds on routerstatuses when computing votes In control: * fmt_serverstatus.c generates the ancient "v1 server status" format that controllers expect. In nodelist: * routerstatus_fmt.c formats routerstatus entries for a consensus, a vote, or for the controller.
2018-09-19Split routerlist.c into 4 separate modulesNick Mathewson
There are now separate modules for: * the list of router descriptors * the list of authorities and fallbacks * managing authority certificates * selecting random nodes
2018-09-16When Tor is compiled with NSS, don't claim support for LinkAuth=1Nick Mathewson
Closes ticket 27288
2018-09-10Defer reporting directory bootstrap progressTaylor Yu
Existing cached directory information can cause misleadingly high bootstrap percentages. To improve user experience, defer reporting of directory information progress until at least one connection has succeeded to a relay or bridge. Closes ticket 27169.
2018-08-21Split X509 code out of tortls.cNick Mathewson
2018-07-25Remove comment about Tor2webteor
Part of #26367.
2018-07-25Merge branch 'bug26924_032' into bug26924teor
Update rendcommon.h include path.