mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 14:43:46 +01:00
Don't prepend reject *:* to Reachable(OR/Dir)Addresses in options_validate()
This commit is contained in:
parent
9ae3597540
commit
fe18776349
@ -3359,7 +3359,6 @@ STATIC int
|
|||||||
options_validate(or_options_t *old_options, or_options_t *options,
|
options_validate(or_options_t *old_options, or_options_t *options,
|
||||||
or_options_t *default_options, int from_setconf, char **msg)
|
or_options_t *default_options, int from_setconf, char **msg)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
config_line_t *cl;
|
config_line_t *cl;
|
||||||
const char *uname = get_uname();
|
const char *uname = get_uname();
|
||||||
int n_ports=0;
|
int n_ports=0;
|
||||||
@ -3680,30 +3679,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Terminate Reachable*Addresses with reject *
|
|
||||||
*/
|
|
||||||
for (i=0; i<3; i++) {
|
|
||||||
config_line_t **linep =
|
|
||||||
(i==0) ? &options->ReachableAddresses :
|
|
||||||
(i==1) ? &options->ReachableORAddresses :
|
|
||||||
&options->ReachableDirAddresses;
|
|
||||||
if (!*linep)
|
|
||||||
continue;
|
|
||||||
/* We need to end with a reject *:*, not an implicit accept *:* */
|
|
||||||
for (;;) {
|
|
||||||
linep = &((*linep)->next);
|
|
||||||
if (!*linep) {
|
|
||||||
*linep = tor_malloc_zero(sizeof(config_line_t));
|
|
||||||
(*linep)->key = tor_strdup(
|
|
||||||
(i==0) ? "ReachableAddresses" :
|
|
||||||
(i==1) ? "ReachableORAddresses" :
|
|
||||||
"ReachableDirAddresses");
|
|
||||||
(*linep)->value = tor_strdup("reject *:*");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((options->ReachableAddresses ||
|
if ((options->ReachableAddresses ||
|
||||||
options->ReachableORAddresses ||
|
options->ReachableORAddresses ||
|
||||||
options->ReachableDirAddresses ||
|
options->ReachableDirAddresses ||
|
||||||
|
Loading…
Reference in New Issue
Block a user