diff options
author | George Kadianakis <desnacked@riseup.net> | 2020-09-07 13:17:41 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2020-09-07 13:30:21 +0300 |
commit | 85a1e6c6018153f76afe175e51e0199dd2651678 (patch) | |
tree | 4331c6a2faa272409159f13f83b3edbd5c68715b /src/win32 | |
parent | 53cd1c9710a14519443e578959a7a11ef8c23d8f (diff) | |
download | tor-85a1e6c6018153f76afe175e51e0199dd2651678.tar.gz tor-85a1e6c6018153f76afe175e51e0199dd2651678.zip |
statistics: Properly count all rendezvous cells (avoid undercounting).
tl;dr We were not counting cells flying from the client to the service, but we
were counting cells flying from the service to the client.
When a rendezvous cell arrives from the client to the RP, the RP forwards it to
the service.
For this to happen, the cell first passes through command_process_relay_cell()
which normally does the statistics counting. However because the `rend_circ`
circuit was not flagged with `circuit_carries_hs_traffic_stats` in
rend_mid_rendezvous(), the cell is not counted there.
Then the cell goes to circuit_receive_relay_cell() which has a special code
block based on `rend_splice` specifically for rendezvous cells, and the cell
gets directly passed to `rend_circ` via a direct call to
circuit_receive_relay_cell(). The cell never passes through
command_process_relay_cell() ever again and hence is never counted by our
rephist module.
The fix here is to flag the `rend_circ` circuit with
`circuit_carries_hs_traffic_stats` so that the cell is counted as soon as it
hits command_process_relay_cell().
Furthermore we avoid double-counting cells since the special code block of
circuit_receive_relay_cell() makes us count rendezvous cells only as they enter
the RP and not as they exit it.
Fixes #40117.
Diffstat (limited to 'src/win32')
0 files changed, 0 insertions, 0 deletions