[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #20823 [Core Tor/Tor]: [controller, prop271] GETINFO support for new guard selection logic
#20823: [controller, prop271] GETINFO support for new guard selection logic
-------------------------------------------------+-------------------------
Reporter: nickm | Owner: nickm
Type: defect | Status:
| needs_review
Priority: High | Milestone: Tor:
| 0.3.0.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: tor-guard regression | Actual Points: .1 so
TorCoreTeam201612 | far
Parent ID: #20822 | Points: 1
Reviewer: | Sponsor:
-------------------------------------------------+-------------------------
Comment (by chelseakomlo):
Hey,
This is a small patch, overall it looks good!
I do get a test failure when I run `make test`:
{{{
entrynodes/retry_unreachable: [forking]
FAIL src/test/test_entrynodes.c:2302: assert(g1->is_reachable OP_EQ
GUARD_REACHABLE_NO): 2 vs 0
[retry_unreachable FAILED]
}}}
as well as a bug assertion:
{{{
dir/purpose_needs_anonymity_returns_true_by_default: Dec 13 20:52:30.319
[warn] purpose_needs_anonymity(): Bug: Called with dir_purpose=0,
router_purp
ose=0 (on Tor 0.3.0.0-alpha-dev 7a7240716eef1f54)
OK
}}}
Not sure if you get these as well? I don't see these on master.
One point about how we switch on whether we are running the legacy or
post-271 algorithm.
If you define two functions- one for the legacy behavior and one for the
post-271 behavior, then when you remove the legacy algorithm, you won't
need to change the post-271 method signature or implementation when you
remove support for legacy in the future.
So it could look something like:
{{{
STATIC char *
legacy_getinfo_helper_format_single_entry_guard(const entry_guard_t *e)
STATIC char *
getinfo_helper_format_single_entry_guard(const entry_guard_t *e)
}}}
for the method signatures. The caller would then look like:
{{{
SMARTLIST_FOREACH_BEGIN(guards, const entry_guard_t *, e) {
char *cp;
#ifdef ENABLE_LEGACY_GUARD_ALGORITHM
cp = legacy_getinfo_helper_format_single_entry_guard(e);
#else
cp = getinfo_helper_format_single_entry_guard(e);
#endif
smartlist_add(sl, cp);
} SMARTLIST_FOREACH_END(e);
}}}
Again, this is minor and it might be less work to leave this as is.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20823#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs