diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2015-09-16 03:58:06 +1000 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2015-09-16 03:58:06 +1000 |
commit | ab6f93caa719c2b2571b771087efba53d3d51bbf (patch) | |
tree | bdebf1d0ccb50e44e3f747a47ace1bee77211a26 /src/or/routerparse.c | |
parent | 047989ea288fa1e3099f1897a3596abd6f2e8860 (diff) | |
download | tor-ab6f93caa719c2b2571b771087efba53d3d51bbf.tar.gz tor-ab6f93caa719c2b2571b771087efba53d3d51bbf.zip |
fixup Only set TAPMP_STAR_IPV6_ONLY if TAPMP_EXTENDED_STAR is set
Also fix a comment.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 10 |
1 files 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; } |