diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-02-03 14:31:31 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-02-03 14:31:31 -0500 |
commit | dafed84dabbb3afbada5e55ac1d030412418fae5 (patch) | |
tree | df6c051634f497ca35060f0ff119fd6b63098c3e /src/or/dirserv.c | |
parent | e82e772f2b1a2b2235d3b3bcde85666e09a182b5 (diff) | |
download | tor-dafed84dabbb3afbada5e55ac1d030412418fae5.tar.gz tor-dafed84dabbb3afbada5e55ac1d030412418fae5.zip |
Fixes for bug4645 fix.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index b6bb607fa9..e3e6519dd8 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -524,20 +524,17 @@ dirserv_free_fingerprint_list(void) static int dirserv_router_has_valid_address(routerinfo_t *ri) { - struct in_addr iaddr; + tor_addr_t addr; 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.", + if (tor_addr_parse(&addr, ri->address) != AF_INET) { + log_info(LD_DIRSERV,"Router %s published non-IPv4 address '%s'. Refusing.", router_describe(ri), ri->address); return -1; } - tor_addr_t toraddr; - tor_addr_from_in(&toraddr,&iaddr); - - if (tor_addr_is_internal(&toraddr, 0)) { + if (tor_addr_is_internal(&addr, 0)) { log_info(LD_DIRSERV, "Router %s published internal IP address '%s'. Refusing.", router_describe(ri), ri->address); |