Opened 3 months ago

Closed 3 months ago

#32094 closed defect (fixed)

hs-v3: Stop using ip->circuit_established flag

Reported by: dgoulet Owned by: dgoulet
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-hs
Cc: Actual Points: 0.1
Parent ID: #30200 Points: 0.2
Reviewer: asn Sponsor: Sponsor27-must

Description

Since #31548, where we forgot to look if the service intro circuit was established, we rely on ip->circuit_established flag to know if we can use the IP (and in many other places as well).

However, this is a bit of a "duplication" of effort because we have the HS circuitmap that keeps all the intro circuits conveniently indexed by IP auth key.

When a circuit closes or is repurposed, that HS map is cleaned up with hs_circ_cleanup() so regardless what caused the circuit to disappear, our map will always be updated properly.

I believe we should stop relying on the ip->circuit_established flag so in the future we don't get out of sync with the map by mistake or assume state based solely on this flag. The HS map is the only real valid state we should be looking at for HS circuit state.

Child Tickets

Change History (5)

comment:1 Changed 3 months ago by dgoulet

Actual Points: 0.1

PR: https://github.com/torproject/tor/pull/1456
Branch: ticket32094_043_01

comment:2 Changed 3 months ago by dgoulet

Status: assignedneeds_review

comment:3 Changed 3 months ago by asn

Status: needs_reviewneeds_revision

Very nice refactoring!
I left a small comment at the tests.

comment:4 in reply to:  3 Changed 3 months ago by dgoulet

Status: needs_revisionneeds_review

Replying to asn:

Very nice refactoring!
I left a small comment at the tests.

Answered.

comment:5 Changed 3 months ago by asn

Resolution: fixed
Status: needs_reviewclosed

oops I missed that part of the commit message. LGTM! Merged!

Note: See TracTickets for help on using tickets.