diff options
author | Roger Dingledine <arma@torproject.org> | 2013-02-09 20:17:48 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2013-02-09 20:49:11 -0500 |
commit | 99185397de44a093456890404b3bb6fbebc3e4ef (patch) | |
tree | d5d19472ceda7de007d25e3e56b0751304c7cdd2 /src | |
parent | d86a45f991693cf2367a6ccb94fc29c22f5f7b45 (diff) | |
download | tor-99185397de44a093456890404b3bb6fbebc3e4ef.tar tor-99185397de44a093456890404b3bb6fbebc3e4ef.tar.gz |
Stop checking if ri->address is an IP
since router_parse_entry_from_string() already checks whether
!tor_inet_aton(router->address, &in)
(And no need to print address, since router_describe does that.)
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirserv.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 620984288..87566470d 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -533,19 +533,12 @@ dirserv_free_fingerprint_list(void) static int dirserv_router_has_valid_address(routerinfo_t *ri) { - struct in_addr iaddr; if (get_options()->DirAllowPrivateAddresses) return 0; /* whatever it is, we're fine with it */ - if (!tor_inet_aton(ri->address, &iaddr)) { - log_info(LD_DIRSERV,"Router %s published non-IP address '%s'. Refusing.", - router_describe(ri), - ri->address); - return -1; - } - if (is_internal_IP(ntohl(iaddr.s_addr), 0)) { + if (is_internal_IP(ri->addr, 0)) { log_info(LD_DIRSERV, - "Router %s published internal IP address '%s'. Refusing.", - router_describe(ri), ri->address); + "Router %s published internal IP address. Refusing.", + router_describe(ri)); return -1; /* it's a private IP, we should reject it */ } return 0; @@ -597,12 +590,10 @@ authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg, } if (dirserv_router_has_valid_address(ri) < 0) { log_fn(severity, LD_DIRSERV, - "Router %s has invalid address '%s'. " - "Not adding (%s).", + "Router %s has invalid address. Not adding (%s).", router_describe(ri), - ri->address, esc_router_info(ri)); - *msg = "Rejected: Address is not an IP, or IP is a private address."; + *msg = "Rejected: Address is a private address."; return -1; } |