If I set ExitNodes to a country digraph (e.g. {fr}) then most of the circuits delivering my traffic exit via the specified country (these are normal 3 hop circuits).
I also see circuits with 4 hops where the third hop will be in my chosen country but the fourth hop will not. I presume these circuits are being used as described in the man page as they seem to appear after a DIR_FETCH. However, once the circuit has been created it is then used to deliver my traffic for aprroximately the next 10 minutes even though the circuit is exiting via a node in the "wrong" country.
Trac: Username: a702599
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I have seen this behavior when monitoring circuit and stream events from the control port.
I see normal 3 hop circuits with user traffic. Then I get 4 hop circuits used for DIR_FETCH and these continue being used for user circuits for about ten minutes. Using various online sites I have confirmed that my exit ip is in the "wrong" country when this is happening.
I am not offering any hidden services, but I have seen this happen following a DIR_FETCH when using hidden services (this may also happen if I don't use hidden services but I am unsure).
Do you see the same behavior if you try 0.2.3.x? I think that the stream isolation code there should prevent it entirely. If not, something screwy is going on.
So, my first shot at this in 0.2.2, if it's an 0.2.2-only issue, would be to add a new circuit purpose for handling anonymized directory connections, since the purpose isolation code seems to work pretty well there. I've got a tentative patch there in branch "bug5283_022_v1" in my public git repository. You can try the patch here:
Warning: it is totally unreviewed by anybody but me, and I've only given it a few minutes of testing. It might or might not work at all, crash horribly, etc.
There's a simpler fix taking a different approach in branch "bug5283_022_v2" (suggested by rransom). It makes these connections require an "internal" circuit, which is probably right.
One issue there is that the expression "(internal == circ->build_state->is_internal)" in circuit_find_to_cannibalize will probably prevent cannibalization.
There's a simpler fix taking a different approach in branch "bug5283_022_v2" (suggested by rransom). It makes these connections require an "internal" circuit, which is probably right.
I like this one better. I added a changes file in my bug5283_022_v2 branch.
One issue there is that the expression "(internal == circ->build_state->is_internal)" in circuit_find_to_cannibalize will probably prevent cannibalization.
It should allow cannibalization -- but now you'd cannibalize 3-hop internal circuits for fulfilling begin_dir requests, rather than 3-hop non-internal circuits. Right?
Weasel says this is in his opinion potentially mergeable into 0.2.2.x, but it took me a while to explain it to him, so I'm going to improve the commit msg before I merge it.