diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-14 20:51:41 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-14 23:16:57 -0500 |
commit | bb2145b45ba5992eae6d647b946b430dd2367375 (patch) | |
tree | 8f066e05ceeffd528be75899deab8197996693c4 /src/or/routerparse.c | |
parent | 85e8d35fca49c0a660e104a85bb727f808b8ffb0 (diff) | |
download | tor-bb2145b45ba5992eae6d647b946b430dd2367375.tar.gz tor-bb2145b45ba5992eae6d647b946b430dd2367375.zip |
Fix a bug in policy_is_reject_star() that was making IPv4 exits break
IPv4-only exits have an implicit "reject [::]/0", which was making
policy_is_reject_star() return 1 for them, making us refuse to do
hostname lookups.
This fix chanes policy_is_reject_star() to ask about which family we meant.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 5607479d6c..82c062cb52 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1574,8 +1574,6 @@ router_parse_entry_from_string(const char *s, const char *end, goto err; }); policy_expand_private(&router->exit_policy); - if (policy_is_reject_star(router->exit_policy)) - router->policy_is_reject_star = 1; if ((tok = find_opt_by_keyword(tokens, K_IPV6_POLICY)) && tok->n_args) { router->ipv6_exit_policy = parse_short_policy(tok->args[0]); @@ -1585,6 +1583,11 @@ router_parse_entry_from_string(const char *s, const char *end, } } + if (policy_is_reject_star(router->exit_policy, AF_INET) && + (!router->ipv6_exit_policy || + short_policy_is_reject_star(router->ipv6_exit_policy))) + router->policy_is_reject_star = 1; + if ((tok = find_opt_by_keyword(tokens, K_FAMILY)) && tok->n_args) { int i; router->declared_family = smartlist_new(); |