aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
AgeCommit message (Collapse)Author
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-06-11Enable -Wnull-dereference (GCC >=6.1), and fix the easy casesNick Mathewson
This warning, IIUC, means that the compiler doesn't like it when it sees a NULL check _after_ we've already dereferenced the variable. In such cases, it considers itself free to eliminate the NULL check. There are a couple of tricky cases: One was the case related to the fact that tor_addr_to_in6() can return NULL if it gets a non-AF_INET6 address. The fix was to create a variant which asserts on the address type, and never returns NULL.
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-05-19Merge branch 'maint-0.2.8'Nick Mathewson
2016-05-09remove some more unused codeRoger Dingledine
2016-04-14Add a BUG macro for usage in if checks.Nick Mathewson
2016-03-28Rename tor_dup_addr to tor_addr_to_str_dup.Nick Mathewson
Patch from icanhasaccount; closes 18462.
2016-03-24Merge remote-tracking branch 'teor/bug18351'Nick Mathewson
2016-03-24Clarify ReachableAddress log messagesteor (Tim Wilson-Brown)
Make it clearer that they are about outgoing connection attempts. Specify the options involved where they were missing from one log message. Clarify a comment.
2016-03-24Downgrade IP version warnings to avoid filling logsteor (Tim Wilson-Brown)
Downgrade logs and backtraces about IP versions to info-level. Only log backtraces once each time tor runs. Assists in diagnosing bug 18351; bugfix on c3cc8e16e in tor-0.2.8.1-alpha. Reported by "sysrqb" and "Christian", patch by "teor".
2016-03-22Merge remote-tracking branch 'public/bug18253'Nick Mathewson
2016-03-14Make unix sockets work with the linux seccomp2 sandbox againNick Mathewson
I didn't want to grant blanket permissions for chmod() and chown(), so here's what I had to do: * Grant open() on all parent directories of a unix socket * Write code to allow chmod() and chown() on a given file only. * Grant chmod() and chown() on the unix socket.
2016-03-14Don't chmod/chown unix sockets if their permissions are already okNick Mathewson
This is a part of a fix for 18253; bugfix on 0.2.8.1-alpha. Alternatively, we could permit chmod/chown in the sandbox, but I really don't like giving the sandbox permission to alter permissions.
2016-03-01First RelaxDirModeCheck implementationPeter Palfrader
2016-02-28Merge remote-tracking branch 'teor/bug18123'Nick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
2016-02-26Set EXCLUSIVEADDRUSE on Win32 to avoid a local port-stealing attackteor (Tim Wilson-Brown)
2016-02-20If both IPv4 and IPv6 addresses could be used, choose one correctlyteor (Tim Wilson-Brown)
If there is a node, use node_ipv6_or/dir_preferred(). If there is no node, use fascist_firewall_prefer_ipv6_or/dirport().
2016-02-11Merge remote-tracking branch 'teor/feature17840-v11-merged-v2'Nick Mathewson
2016-02-11Split a long lineNick Mathewson
2016-02-11Merge remote-tracking branch 'weasel/bug18261'Nick Mathewson
2016-02-07Using router_get_my_routerinfo()Harini Kannan
2016-02-06Fix a segfault during startupPeter Palfrader
If unix socket was configured as listener (such as a ControlSocket or a SocksPort unix socket), and tor was started as root but not configured to switch to another user, tor would segfault while trying to string compare a NULL value. Fixes bug 18261; bugfix on 0.2.8.1-alpha. Patch by weasel.
2016-01-29Merge branch 'feature17840-v11-squashed' into feature17840-v11-mergedteor (Tim Wilson-Brown)
Conflicts: src/or/directory.c src/test/test_routerlist.c Fix minor conflicts.
2016-01-29Minor whitespace-only fixteor (Tim Wilson-Brown)
2016-01-29Use fascist firewall and ClientUseIPv4 for bridge clientsteor (Tim Wilson-Brown)
Bridge clients ignore ClientUseIPv6, acting as if it is always 1. This preserves existing behaviour. Make ClientPreferIPv6OR/DirPort auto by default: * Bridge clients prefer IPv6 by default. * Other clients prefer IPv4 by default. This preserves existing behaviour.
2016-01-29Log when IPv4/IPv6 restrictions or preferences weren't metteor (Tim Wilson-Brown)
2016-01-29Choose directory servers by IPv4/IPv6 preferencesteor (Tim Wilson-Brown)
Add unit tests, refactor pick_directory functions.
2016-01-29Add ClientUseIPv4 and ClientPreferIPv6DirPort torrc optionsteor (Tim Wilson-Brown)
ClientUseIPv4 0 tells tor to avoid IPv4 client connections. ClientPreferIPv6DirPort 1 tells tor to prefer IPv6 directory connections. Refactor policy for IPv4/IPv6 preferences. Fix a bug where node->ipv6_preferred could become stale if ClientPreferIPv6ORPort was changed after the consensus was loaded. Update documentation, existing code, add unit tests.
2016-01-27Correct further grammatical errors in tor commentsNick Mathewson
Avoid using a pronoun where it makes comments unclear. Avoid using gender for things that don't have it. Avoid assigning gender to people unnecessarily.
2016-01-26Correct grammatical errors in tor commentsteor (Tim Wilson-Brown)
Avoid using gender for things that don't have it. Avoid assigning a gender to tor users.
2015-12-17Add missing parenthesescypherpunks
2015-12-17Remove Windows specific data type usagecypherpunks
The Tor code base already contains usage of setsockopt(2) with an int as their option value without problems.
2015-12-17Conform to the type signature of setsockopt(2)cypherpunks
According to the POSIX standard the option value is a pointer to void and the option length a socklen_t. The Windows implementation makes the option value be a pointer to character and the option length an int. Casting the option value to a pointer to void conforms to the POSIX standard while the implicit cast to a pointer to character conforms to the Windows implementation. The casts of the option length to the socklen_t data type conforms to the POSIX standard. The socklen_t data type is actually an alias of an int so it also conforms to the Windows implementation.
2015-12-16More emergency-check code for un-removed pending entry connsNick Mathewson
This might also be what #17752 needs.
2015-12-15clean whitespaceNick Mathewson
2015-12-16Prop210: Refactor connection_get_* to produce lists and countsteor (Tim Wilson-Brown)
2015-12-10Whitespace fixNick Mathewson
2015-12-10Defer creation of Unix socket until after setuidJamie Nguyen
2015-12-10Refactor clock skew warning code to avoid duplicationArlo Breault
2015-12-07Comment-only change to connection_get_by_type_addr_port_purposeteor (Tim Wilson-Brown)
connection_get_by_type_addr_port_purpose also ignores connections that are marked for close.
2015-12-07Comment-only changes to connection_connectteor (Tim Wilson-Brown)
port is in host order (addr is tor_addr_t, endianness is abstracted). addr and port can be different to conn->addr and conn->port if connecting via a proxy.
2015-11-27More fixes/debugging attempts for 17659Nick Mathewson
2015-08-23Unit test dns_resolve(), dns_clip_ttl(), dns_get_expiry_ttl().rl1987
2015-07-30Do not autoflush control connections as their outbufs get bigNick Mathewson
Doing this is no longer necessary, and it leads to weird recursions in our call graph. Closes ticket 16480.
2015-07-16Merge remote-tracking branch 'sysrqb/bug15220_026_sysrqb'Nick Mathewson
2015-06-28fix a windows unused var warningNick Mathewson
2015-06-25Validate the open file limit when creating a socketDavid Goulet
Fixes #16288 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-06-04Merge remote-tracking branch 'origin/maint-0.2.6'Nick Mathewson