From ab6f93caa719c2b2571b771087efba53d3d51bbf Mon Sep 17 00:00:00 2001 From: "teor (Tim Wilson-Brown)" Date: Wed, 16 Sep 2015 03:58:06 +1000 Subject: [PATCH] fixup Only set TAPMP_STAR_IPV6_ONLY if TAPMP_EXTENDED_STAR is set Also fix a comment. --- src/or/routerparse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 7bb18ecc30..8e56d16724 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -3795,8 +3795,11 @@ router_add_exit_policy(routerinfo_t *router, directory_token_t *tok) return 0; } -/** Given a K_ACCEPT or K_REJECT token and a router, create and return - * a new exit_policy_t corresponding to the token. */ +/** 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. 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 * 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. * (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; } -- 2.11.4.GIT