commit fc9e84062b73535b63bb3cf555604b1acbcc4c61 Merge: dfc3217 408bd98 Author: Nick Mathewson nickm@torproject.org Date: Tue Apr 1 21:49:01 2014 -0400
Merge remote-tracking branch 'public/bug4645'
Conflicts: src/or/dirserv.c
changes/ticket4645 | 3 +++ src/common/address.c | 13 ------------- src/common/address.h | 1 - src/or/config.c | 21 +++++++++++++-------- src/or/directory.c | 9 +++++---- src/or/dirserv.c | 5 ++++- src/test/test_addr.c | 1 - 7 files changed, 25 insertions(+), 28 deletions(-)
diff --cc src/or/dirserv.c index 19ed12d,e3e6519..b6c5dd4 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@@ -504,12 -524,20 +504,15 @@@ dirserv_free_fingerprint_list(void static int dirserv_router_has_valid_address(routerinfo_t *ri) { + tor_addr_t addr; if (get_options()->DirAllowPrivateAddresses) return 0; /* whatever it is, we're fine with it */ - if (is_internal_IP(ri->addr, 0)) { - 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_from_ipv4h(&addr, ri->addr); + + if (tor_addr_is_internal(&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;
tor-commits@lists.torproject.org