mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Ignore accept6/reject6 IPv4, warn about unexpected rule outcomes
When parsing torrc ExitPolicies, we now warn if:
* an IPv4 address is used on an accept6 or reject6 line. The line is
ignored, but the rest of the policy items in the list are used.
(accept/reject continue to allow both IPv4 and IPv6 addresses in torrcs.)
* a "private" address alias is used on an accept6 or reject6 line.
The line filters both IPv4 and IPv6 private addresses, disregarding
the 6 in accept6/reject6.
When parsing torrc ExitPolicies, we now issue an info-level message:
* when expanding an accept/reject * line to include both IPv4 and IPv6
wildcard addresses.
In each instance, usage advice is provided to avoid the message.
Partial fix for ticket 16069. Patch by "teor".
Patch on 2eb7eafc9d and a96c0affcb (25 Oct 2012),
released in 0.2.4.7-alpha.
This commit is contained in:
@@ -690,6 +690,10 @@ tor_addr_parse_mask_ports(const char *s,
|
||||
if (flags & TAPMP_EXTENDED_STAR) {
|
||||
family = AF_UNSPEC;
|
||||
tor_addr_make_unspec(addr_out);
|
||||
log_info(LD_GENERAL,
|
||||
"'%s' expands into rules which apply to all IPv4 and IPv6 "
|
||||
"addresses. (Use accept/reject *4:* for IPv4 or "
|
||||
"accept[6]/reject[6] *6:* for IPv6.)", s);
|
||||
} else {
|
||||
family = AF_INET;
|
||||
tor_addr_from_ipv4h(addr_out, 0);
|
||||
|
||||
Reference in New Issue
Block a user