mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
make router_is_general_exit match its documentation
but it's still wrong maybe svn:r5095
This commit is contained in:
parent
ba49b45682
commit
19f04ae9c3
@ -1095,7 +1095,7 @@ static int
|
|||||||
router_is_general_exit(routerinfo_t *ri)
|
router_is_general_exit(routerinfo_t *ri)
|
||||||
{
|
{
|
||||||
static const int ports[] = { 80, 443, 6667 };
|
static const int ports[] = { 80, 443, 6667 };
|
||||||
int n_allowed = 3;
|
int n_allowed = 0;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 3; ++i) {
|
for (i = 0; i < 3; ++i) {
|
||||||
struct addr_policy_t *policy = ri->exit_policy;
|
struct addr_policy_t *policy = ri->exit_policy;
|
||||||
@ -1107,8 +1107,8 @@ router_is_general_exit(routerinfo_t *ri)
|
|||||||
if ((policy->addr & 0xff000000ul) == 0x7f000000ul)
|
if ((policy->addr & 0xff000000ul) == 0x7f000000ul)
|
||||||
continue; /* 127.x */
|
continue; /* 127.x */
|
||||||
/* We have a match that is at least a /8. */
|
/* We have a match that is at least a /8. */
|
||||||
if (policy->policy_type != ADDR_POLICY_ACCEPT)
|
if (policy->policy_type == ADDR_POLICY_ACCEPT)
|
||||||
--n_allowed;
|
++n_allowed;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user