mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
fixup Only set TAPMP_STAR_IPV6_ONLY if TAPMP_EXTENDED_STAR is set
Also fix a comment.
This commit is contained in:
parent
047989ea28
commit
ab6f93caa7
1 changed files with 7 additions and 3 deletions
|
@ -3795,8 +3795,11 @@ router_add_exit_policy(routerinfo_t *router, directory_token_t *tok)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Given a K_ACCEPT or K_REJECT token and a router, create and return
|
/** Given a K_ACCEPT[6] or K_REJECT[6] token and a router, create and return
|
||||||
* a new exit_policy_t corresponding to the token. */
|
* a new exit_policy_t corresponding to the token. If TAPMP_EXTENDED_STAR
|
||||||
|
* is set in fmt_flags, K_ACCEPT6 and K_REJECT6 tokens followed by *
|
||||||
|
* expand to IPv6-only policies, otherwise they expand to IPv4 and IPv6
|
||||||
|
* policies */
|
||||||
static addr_policy_t *
|
static addr_policy_t *
|
||||||
router_parse_addr_policy(directory_token_t *tok, unsigned fmt_flags)
|
router_parse_addr_policy(directory_token_t *tok, unsigned fmt_flags)
|
||||||
{
|
{
|
||||||
|
@ -3822,7 +3825,8 @@ router_parse_addr_policy(directory_token_t *tok, unsigned fmt_flags)
|
||||||
|
|
||||||
/* accept6/reject6 * produces an IPv6 wildcard address only.
|
/* accept6/reject6 * produces an IPv6 wildcard address only.
|
||||||
* (accept/reject * produces rules for IPv4 and IPv6 wildcard addresses.) */
|
* (accept/reject * produces rules for IPv4 and IPv6 wildcard addresses.) */
|
||||||
if (tok->tp == K_ACCEPT6 || tok->tp == K_REJECT6) {
|
if ((fmt_flags & TAPMP_EXTENDED_STAR)
|
||||||
|
&& (tok->tp == K_ACCEPT6 || tok->tp == K_REJECT6)) {
|
||||||
fmt_flags |= TAPMP_STAR_IPV6_ONLY;
|
fmt_flags |= TAPMP_STAR_IPV6_ONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue