Since relay_send_command_from_edge() already does mark failed circs for close there is no reason to do it again.
Please see the patch attached or branch duplicate-mark-for-close at https://gitlab.com/nogoegst/tor.
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.
Only OR-side circs should be filtered out here. So relay_send_command_from_edge() should not be called on such circuits, right? If yes, there should be an assertion instead of return -1.
So I had to think hard about this one as it has quite a bit of implication especially when adding an assert like that. I've refactored your branch slightly (and fixing couple things) in this branch: bug20376_030_01.
The main part you'll notice is the change to relay_send_command_from_edge_() which I turned into a simple if/else (no unknown else condition anymore) where we either have a origin circuit or not and depending on that, we set the direction and assert on the cpath_layer which MUST be present if we are outbound. As far as I understand it, that function only does OP->OR or OR->OP meaning it can't be a middle hop and thus if it's an origin circuit, it must be outbound and have a cpath else we are using that function very wrong.
As far as I understand it, that function only does OP->OR or OR->OP meaning it can't be a middle hop and thus if it's an origin circuit, it must be outbound and have a cpath else we are using that function very wrong.
Just checked your branch. Thanks, the condition now looks much better! Comments and fixed callsites look good to me also.