summaryrefslogtreecommitdiff
path: root/src/lib/net
AgeCommit message (Collapse)Author
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-10Merge branch 'bug31615_041' into bug31615_masterteor
Merged modified lines from bug31615_041, and unmodified lines from master.
2019-09-10Merge branch 'bug31615_040' into bug31615_041teor
Merged modified lines from bug31615_040, and unmodified lines from maint-0.4.1.
2019-09-06subsys: Make the subsystem init order match the module dependenciesteor
Fix levels for subsystems that depend on log/err * winprocess (security) doesn't use err: * call windows process security APIs as early as possible * init err after winprocess * move wallclock so it's still after err * network and time depend on log: * make sure that network and time can use logging. * init network and time after log Add comments explaining the module init order. Fixes bug 31615; bugfix on 0.4.0.1-alpha.
2019-06-26Merge branch 'bug30721_squashed'Nick Mathewson
2019-06-26address/resolve: Require square brackets on IPv6 address:portsteor
When parsing addreses via Tor's internal address:port parsing and DNS lookup APIs, require IPv6 addresses with ports to have square brackets. But allow IPv6 addresses without ports, whether or not they have square brackets. Fixes bug 30721; bugfix on 0.2.1.5-alpha.
2019-06-26address/resolve: try harder to avoid returning uninitialised datateor
Cleanup after 30721.
2019-06-26resolve: split sub-functions out of tor_addr_lookup()teor
And remove the practracker exception for tor_addr_lookup(). Cleanup after 30721.
2019-06-26resolve: refactor address family logic in tor_addr_lookup()teor
Cleanup after 30721.
2019-06-26resolve: consistently parse IP addresses in square bracketsteor
When parsing addreses via Tor's internal DNS lookup API: * reject IPv4 addresses in square brackets (with or without a port), * accept IPv6 addresses in square brackets (with or without a port), and * accept IPv6 addresses without square brackets, as long as they have no port. This change completes the work started in 23082, making address parsing consistent between tor's internal DNS lookup and address parsing APIs. Fixes bug 30721; bugfix on 0.2.1.5-alpha.
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-28Trivial fix for a trivial warning with gcc 9.1.1Nick Mathewson
Fix on 4e3d144fb0940d8ee5a89427d471ea3656e8e122; bug not in any released Tor.
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2019-04-11Don't leak on logic error in string_is_valid_nonrfc_hostname()Nick Mathewson
This is CID 1437438. No backport needed: this is unreachable, and guarded with a BUG() check.
2019-03-12Merge branch 'tor-github/pr/763' into maint-0.4.0George Kadianakis
2019-03-08Merge remote-tracking branch 'bug28525_029' into maint-0.3.5teor
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2019-01-14Merge remote-tracking branch 'teor/bug29015'Nick Mathewson
2019-01-09Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-09Merge remote-tracking branch 'tor-github/pr/636' into maint-0.3.5Nick Mathewson
2019-01-09Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-09Fix (and make consistent) the use of OpenBSD preprocessor macro testsKris Katterjohn
Prior to this commit, the testsuite was failing on OpenBSD. After this commit the testsuite runs fine on OpenBSD. It was previously decided to test for the OpenBSD macro (rather than __OpenBSD__, etc.) because OpenBSD forks seem to have the former macro defined. sys/param.h must be included for the OpenBSD macro definition; however, many files tested for the OpenBSD macro without having this header included. This commit includes sys/param.h in the files where the OpenBSD macro is used (and sys/param.h is not already included), and it also changes some instances of the __OpenBSD__ macro to OpenBSD. See commit 27df23abb675ffeb198bf0c1cc85c4baed77a988 which changed everything to use OpenBSD instead of __OpenBSD__ or OPENBSD. See also tickets #6982 and #20980 (the latter ticket is where it was decided to use the OpenBSD macro). Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
2019-01-08lib/net: improve the docs for tor_{ersatz_,}socketpair()teor
Add some details about IP family support, and point to tor_socketpair() from tor_ersatz_socketpair(). Closes ticket 29015.
2019-01-07Fix tor_ersatz_socketpair on IPv6-only systemsKris Katterjohn
In get_local_listener used by tor_ersatz_socketpair, the address family used when binding the IPv6 socket was AF_INET instead of AF_INET6. Fixes bug 28995; bugfix on 0.3.5.1-alpha. Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
2019-01-03Add a #ifdef HAVE_UNISTD_H check to buffers.cNick Mathewson
Reported on tor-dev by Gisle Vanem. Bug not in any released Tor (The suggested patch used _MSC_VER, but that's not how we do stuff with autoconf. With autoconf, you detect the feature you want, rather than trying to list all the systems that do or do not have it.)
2018-12-17Merge branch 'ticket28179_squashed' into ticket28179_squashed_mergedNick Mathewson
2018-12-17Use errno directly if we are not reading/writing from/to a socket.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Add documentation for the is_socket and error argument of read_to_chunk().Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-05Merge remote-tracking branch 'tor-github/pr/508'Nick Mathewson
2018-12-01Move net.inet.ip.random_id code to lib/net/Nick Mathewson
2018-11-27Add buf_flush_to_pipe() and buf_read_from_pipe().Alexander Færøy
This patch adds two new functions: buf_flush_to_pipe() and buf_read_from_pipe(), which makes use of our new buf_flush_to_fd() and buf_read_from_fd() functions. See: https://bugs.torproject.org/28179
2018-11-27Refactor buf_read_from_socket() into buf_read_from_fd().Alexander Færøy
This patch refactors buf_read_from_socket() into buf_read_from_fd(), and creates a specialized function for buf_read_from_socket(), which uses buf_read_from_fd(). See: https://bugs.torproject.org/28179
2018-11-27Refactor buf_flush_to_socket() into buf_flush_to_fd().Alexander Færøy
This patch refactors buf_flush_to_socket() into buf_flush_to_fd() and creates a specialization function for buf_flush_to_socket() that makes use of buf_flush_to_fd(). See: https://bugs.torproject.org/28179
2018-11-27Refactor flush_chunk() to work on pipes as well as sockets.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-27Refactor read_to_chunk() such that it supports both pipes and sockets.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-14Make sure sandbox-related getaddrinfo() functions always exist.Nick Mathewson
2018-11-14Normalize .may_include to always have paths, and paths to includeNick Mathewson
2018-11-14Move buffers.c out of lib/containers to resolve a circularity.Nick Mathewson
2018-11-09Merge branch 'subsystems'Nick Mathewson
2018-11-09Rename subsystem callback functions to make them consistentNick Mathewson
2018-11-06Add a user of CTASSERT().Nick Mathewson
2018-11-05Move networking startup/cleanup logic into a subsystem.Nick Mathewson
2018-10-30Merge branch 'ticket23082_squashed'Nick Mathewson
2018-10-30Code cleanups for tor_addr_parse()rl1987
2018-10-30Move a check for trailing colon to tor_inet_pton()rl1987
That way, string_is_valid_ipv6_address() can benefit from it
2018-09-20Add a tor_release_socket_ownership() function.Nick Mathewson
2018-09-13Include torint.h in socketpair.c for intptr_t definition.Nick Mathewson
2018-09-07Merge remote-tracking branch 'teor/bug27521'Nick Mathewson
2018-09-07Comment: Fix typos in get_interface_addresses_win32()teor
Closes 27521.