diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2015-11-16 13:58:26 +1100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2015-11-20 10:32:51 +1100 |
commit | c73c5a293f645c9d5a15b3f17946e4d44245a58e (patch) | |
tree | 75d11d66b26413f79baffebdb438ad5efc9f0e49 /src/or/policies.h | |
parent | 913fbf8f2f9eea36ccef6100608295d8c8ce449a (diff) | |
download | tor-c73c5a293f645c9d5a15b3f17946e4d44245a58e.tar.gz tor-c73c5a293f645c9d5a15b3f17946e4d44245a58e.zip |
Refactor policies_parse_exit_policy_internal
Move the code that rejects publicly routable exit relay addresses
to policies_parse_exit_policy_reject_private. Add
addr_policy_append_reject_addr_list and use it to reject interface
addresses.
This removes the duplicate reject checks on local_address and
ipv6_local_address, but duplicates will be removed by
exit_policy_remove_redundancies at the end of the function.
This also removes the info-level logging on rejected interface
addresses. Instead, log a debug-level message in
addr_policy_append_reject_addr.
This simplifies policies_parse_exit_policy_internal and prepares for
reporting these addresses over the control port in #17183.
Diffstat (limited to 'src/or/policies.h')
-rw-r--r-- | src/or/policies.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/policies.h b/src/or/policies.h index f200d7babe..97350f5751 100644 --- a/src/or/policies.h +++ b/src/or/policies.h @@ -58,9 +58,16 @@ int policies_parse_exit_policy(config_line_t *cfg, smartlist_t **dest, uint32_t local_address, tor_addr_t *ipv6_local_address, int reject_interface_addresses); +void policies_parse_exit_policy_reject_private(smartlist_t **dest, + int ipv6_exit, + uint32_t local_address, + tor_addr_t *ipv6_local_address, + int reject_interface_addresses); void policies_exit_policy_append_reject_star(smartlist_t **dest); void addr_policy_append_reject_addr(smartlist_t **dest, const tor_addr_t *addr); +void addr_policy_append_reject_addr_list(smartlist_t **dest, + const smartlist_t *addrs); void policies_set_node_exitpolicy_to_reject_all(node_t *exitrouter); int exit_policy_is_general_exit(smartlist_t *policy); int policy_is_reject_star(const smartlist_t *policy, sa_family_t family); |