Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 823
    • Issues 823
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Merge requests
  • !140

statistics: Properly count all rendezvous cells (avoid undercounting). [035+]

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged George Kadianakis requested to merge asn/tor:bug40117_035 into maint-0.3.5 Sep 07, 2020
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 2

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 (closed).

Edited Sep 07, 2020 by George Kadianakis
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: bug40117_035