aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
AgeCommit message (Collapse)Author
2018-06-21Bug 26214: Check stream SENDME against max.Mike Perry
2018-06-01Bug 26259: Don't count 0-length RELAY_COMMAND_DATA in CIRC_BW OVERHEADMike Perry
This cell should be treated as invalid for purposes of CIRC_BW.
2018-05-16Add comments explaining when a connected cell has an UNSPEC addrNick Mathewson
Should prevent other bugs like 26117.
2018-05-15Bug 26117: Move CIRC_BW field accounting.Mike Perry
Previously, we used the AF_UNSPEC check to represent valid connected cell data as a result of the lack of return. This was incorrect.
2018-05-16Merge branch 'maint-0.3.3'Nick Mathewson
2018-05-16Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-05-16Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-05-16Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-05-14Add a missing return after marking a stream for bad connected cellNick Mathewson
Fixes bug 26072; bugfix on 0.2.4.7-alpha.
2018-05-14Merge branch 'bug25903_v5_squashed'Nick Mathewson
2018-05-14Bug 25903: TestsMike Perry
2018-05-09Bug 25903: Perform accounting for new CIRC_BW fields.Mike Perry
Two new values in each direction. DELIVERED counts valid end-to-end circuit data that is accepted by our end and OVERHEAD counts the slack unused data in each of the relay command cells for those accepted cells. Control port changes are in the next commit.
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-22Merge remote-tracking branch 'mikeperry/bug25400_squashed'Nick Mathewson
2018-04-17Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-17heartbeat: Log the number of circuits killed because too many cellsDavid Goulet
We recently merged a circuit cell queue size safeguard. This commit adds the number of killed circuits that have reached the limit to the DoS heartbeat. It now looks like this: [notice] DoS mitigation since startup: 0 circuits killed with too many cells. 0 circuits rejected, 0 marked addresses. 0 connections closed. 0 single hop clients refused. Second thing that this patch does. It makes tor always print the DoS mitigation heartbeat line (for a relay) even though no DoS mitigation have been enabled. The reason is because we now kill circuits that have too many cells regardless on if it is enabled or not but also it will give the operator a chance to learn what is enabled with the heartbeat instead of suddenly appearing when it is enabled by let say the consensus. Fixes #25824 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-16Use u32 add helper for CIRC_BW accounting.Mike Perry
There are quite a few other places this could be used, but keeping it simple for now.
2018-04-16Bug 25400: Make CIRC_BW event properly total everything on a circ.Mike Perry
2018-04-16Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-16relay: Implement a circuit cell queue maximum sizeDavid Goulet
This commit introduces the consensus parameter "circ_max_cell_queue_size" which controls the maximum number of cells a circuit queue should have. The default value is currently 50000 cells which is above what should be expected but keeps us a margin of error for padding cells. Related to this is #9072. Back in 0.2.4.14-alpha, we've removed that limit due to a Guard discovery attack. Ticket #25226 details why we are putting back the limit due to the memory pressure issue on relays. Fixes #25226 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-04-05Merge remote-tracking branch 'public/split_relay_crypto'Nick Mathewson
2018-04-04relay: Remove max middle cells dead codeDavid Goulet
Next commit is addressing the circuit queue cell limit so cleanup before doing anything else. Part of #25226 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-01misc tiny fixesRoger Dingledine
2018-03-19Merge branch 'ticket25268_034_01'Nick Mathewson
2018-03-17Move relay-crypto functions from relay.[ch] to relay_crypto.[ch]Nick Mathewson
This should help us improve modularity, and should also make it easier for people to experiment with other relay crypto strategies down the road. This commit is pure function movement.
2018-03-17Extract the crypto parts of circuit_package_relay_cell.Nick Mathewson
2018-03-17Rename 'relay_crypt' to 'relay_decrypt_cell'Nick Mathewson
This function is used upon receiving a cell, and only handles the decrypting part. The encryption part is currently handled inside circuit_package_relay_cell.
2018-02-16Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-02-16Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-02-15Merge branch 'bug24914'Nick Mathewson
2018-02-15Merge remote-tracking branch 'valentecaio/t-24714'Nick Mathewson
2018-02-15cmux: Remove PARANOIA assert functionsDavid Goulet
The reason to do so is because these functions haven't been used in years so since 0.2.4, every callsite is NOP. In future commits, we'll remove the round robin circuit policy which is mostly validated within those function. This simplifies the code greatly and remove dead code for which we never had a configure option in the first place nor an easy way to use them in production. Part of #25268 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-02Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-02geoip: Hook the client history cache into the OOM handlerDavid Goulet
If the cache is using 20% of our maximum allowed memory, clean 10% of it. Same behavior as the HS descriptor cache. Closes #25122 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-01refactor: rename connection_t struct fields.Caio Valente
connection_t.timestamp_lastwritten renamed to connection_t.timestamp_last_write_allowed connection_t.timestamp_lastread renamed to connection_t.timestamp_last_read_allowed Closes ticket 24714.
2018-01-25In relay_digest_matches(), use stack instead of heap.Nick Mathewson
We'd been using crypto_digest_dup() and crypto_digest_assign() here, but they aren't necessary. Instead we can just use the stack to store the previous state of the SHA_CTX and avoid a malloc/free pair. Closes ticket 24914.
2018-01-10Merge remote-tracking branch 'ffmancera/github/bug24501'Nick Mathewson
2017-12-21In 0.3.3, we use timestamps, not absolute milliseconds.Nick Mathewson
2017-12-21Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-21Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2017-12-21Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-12-21Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-12-21Use monotime_coarse_absolute_msec() in destroy queueNick Mathewson
This way it will match the insert queue in 029 and later.
2017-12-21Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-12-21Merge branch 'maint-0.2.5' into maint-0.2.8maint-0.2.8Nick Mathewson
2017-12-21Move destroy cells into a separate queue type of their own, to save RAMNick Mathewson
We've been seeing problems with destroy cells queues taking up a huge amount of RAM. We can mitigate this, since while a full packed destroy cell takes 514 bytes, we only need 5 bytes to remember a circuit ID and a reason. Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues were introduced.
2017-12-20Add some values to OOM log msg #24501Fernando Fernandez Mancera
Exposing cell_queues_get_total_allocation(), buf_get_total_allocation(), tor_compress_get_total_allocation(), tor_compress_get_total_allocation() when hit MaxMemInQueues threshold. Fixes #24501 Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Change the free macro convention in the rest of src/or/*.hNick Mathewson