aboutsummaryrefslogtreecommitdiff
path: root/src/or/policies.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-15 12:58:13 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-15 13:04:12 -0400
commit6aef89bda4800384eddf79e42d965c2b011acdb4 (patch)
tree59bdfe03904c596f884bede76cdddecaa84c9641 /src/or/policies.c
parentf40df02f3e26df792b7e364d1b6ea5dab167405c (diff)
downloadtor-6aef89bda4800384eddf79e42d965c2b011acdb4.tar.gz
tor-6aef89bda4800384eddf79e42d965c2b011acdb4.zip
Remove compare_addr_to_node_policy
Instead, use compare_tor_addr_to_node_policy everywhere. One advantage of this is that compare_tor_addr_to_node_policy can better distinguish 0.0.0.0 from "unknown", which caused a nasty bug with microdesc users.
Diffstat (limited to 'src/or/policies.c')
-rw-r--r--src/or/policies.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index 93cae768e9..40e5277478 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -689,7 +689,7 @@ compare_tor_addr_to_addr_policy(const tor_addr_t *addr, uint16_t port,
if (!policy) {
/* no policy? accept all. */
return ADDR_POLICY_ACCEPTED;
- } else if (tor_addr_is_null(addr)) {
+ } else if (addr == NULL || tor_addr_is_null(addr)) {
tor_assert(port != 0);
return compare_unknown_tor_addr_to_addr_policy(port, policy);
} else if (port == 0) {
@@ -1461,17 +1461,6 @@ short_policy_is_reject_star(const short_policy_t *policy)
* <b>node</b>. See compare_tor_addr_to_addr_policy for details on addr/port
* interpretation. */
addr_policy_result_t
-compare_addr_to_node_policy(uint32_t addr, uint16_t port, const node_t *node)
-{
- tor_addr_t a;
- tor_addr_from_ipv4h(&a, addr);
- return compare_tor_addr_to_node_policy(&a, port, node);
-}
-
-/** Decides whether addr:port is probably or definitely accepted or rejcted by
- * <b>node</b>. See compare_tor_addr_to_addr_policy for details on addr/port
- * interpretation. */
-addr_policy_result_t
compare_tor_addr_to_node_policy(const tor_addr_t *addr, uint16_t port,
const node_t *node)
{