Merge branch 'maint-0.3.2' into release-0.3.2
This commit is contained in:
commit
a71552268d
|
@ -0,0 +1,5 @@
|
||||||
|
o Minor features:
|
||||||
|
- Make the "Exit" flag assignment only depend on whether the exit
|
||||||
|
policy allows connections to ports 80 and 443. Previously relays
|
||||||
|
would get the Exit flag if they allowed connections to one of
|
||||||
|
these ports and also port 6667. Resolves ticket 23637.
|
|
@ -2186,21 +2186,16 @@ exit_policy_is_general_exit_helper(smartlist_t *policy, int port)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return true iff <b>ri</b> is "useful as an exit node", meaning
|
/** Return true iff <b>ri</b> is "useful as an exit node", meaning
|
||||||
* it allows exit to at least one /8 address space for at least
|
* it allows exit to at least one /8 address space for each of ports 80
|
||||||
* two of ports 80, 443, and 6667. */
|
* and 443. */
|
||||||
int
|
int
|
||||||
exit_policy_is_general_exit(smartlist_t *policy)
|
exit_policy_is_general_exit(smartlist_t *policy)
|
||||||
{
|
{
|
||||||
static const int ports[] = { 80, 443, 6667 };
|
|
||||||
int n_allowed = 0;
|
|
||||||
int i;
|
|
||||||
if (!policy) /*XXXX disallow NULL policies? */
|
if (!policy) /*XXXX disallow NULL policies? */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
return (exit_policy_is_general_exit_helper(policy, 80) &&
|
||||||
n_allowed += exit_policy_is_general_exit_helper(policy, ports[i]);
|
exit_policy_is_general_exit_helper(policy, 443));
|
||||||
}
|
|
||||||
return n_allowed >= 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return false if <b>policy</b> might permit access to some addr:port;
|
/** Return false if <b>policy</b> might permit access to some addr:port;
|
||||||
|
|
Loading…
Reference in New Issue