Many of the macros are missing arguments - it's confusing to have a macro use or modify a variable that isn't listed in its arguments.
Almost all of SKIP_IF_ALREADY_DIR_FETCHING() could become a function, except for the body of the if statement, which is small enough to make it ok to duplicate.
Some code just seems to move around or be reformatted - it might be better to put whitespace-only changes in their own commit.
In general, these changes would be easier to review if each refactored macro or function was in its own commit.
I've removed all the whitespace changes, split the changes into two isolated commits, removed the SKIP_IF_ALREADY_DIR_FETCHING macro from the previous patch and instead generalised the function to support both of the variants that was needed before.
I've removed the SKIP_EXCLUDED macro from the previous revision since I do not believe it actually adds any simplification to the code, since the body is just an increment and a continue statement.
Looks like a good start, and I'd be happy to take it as-is, but unless I'm missing something it doesn't yet actually unify the two functions yet? They're still two separate functions with mostly duplicated logic.
I've merged it, with a change to pass tor_addr_t by reference rather than on the stack. Calling this ticket "new" again.
Trac: Keywords: review-group-15 deleted, N/Aadded Status: needs_review to new