diff options
Diffstat (limited to 'src/or/routers.c')
-rw-r--r-- | src/or/routers.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/routers.c b/src/or/routers.c index 248a07d93..be6eef1d7 100644 --- a/src/or/routers.c +++ b/src/or/routers.c @@ -1061,6 +1061,16 @@ policy_read_failed: return -1; } +/* Addr is 0 for "IP unknown". + * + * Returns -1 for 'rejected', 0 for accepted, 1 for 'maybe' (since IP is + * unknown. + */ +int router_supports_exit_address(uint32_t addr, uint16_t port, + routerinfo_t *router) +{ + return router_compare_addr_to_exit_policy(addr, port, router->exit_policy); +} /* Addr is 0 for "IP unknown". * @@ -1075,8 +1085,6 @@ int router_compare_addr_to_exit_policy(uint32_t addr, uint16_t port, struct in_addr in; struct exit_policy_t *tmpe; - assert(desc_routerinfo); - for(tmpe=policy; tmpe; tmpe=tmpe->next) { log_fn(LOG_DEBUG,"Considering exit policy %s", tmpe->string); if (!addr) { @@ -1117,8 +1125,6 @@ int router_compare_addr_to_exit_policy(uint32_t addr, uint16_t port, * Else return -1. */ int router_compare_to_exit_policy(connection_t *conn) { - struct exit_policy_t *tmpe; - assert(desc_routerinfo); if (router_compare_addr_to_exit_policy(conn->addr, conn->port, |