summaryrefslogtreecommitdiff
path: root/src/app/config/resolve_addr.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-06-23 10:43:39 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-06-24 13:51:37 -0400
commit2f3b4e38888116f434297fb45ac093acd2d01e55 (patch)
tree87c882dc262e5056f66383f6892e72d3c2168b5f /src/app/config/resolve_addr.h
parent7795dd7ef6fa01202b91d20a0ac82eda1456cef8 (diff)
downloadtor-2f3b4e38888116f434297fb45ac093acd2d01e55.tar.gz
tor-2f3b4e38888116f434297fb45ac093acd2d01e55.zip
addr: Refactor is_local_addr() to support IPv6
Series of changes: 1. Rename function to reflect the namespace of the file. 2. Use the new last resolved cache instead of the unused last_resolved_addr_v4 (which is also removed in this commit). 3. Make the entire code base use the new resolved_addr_is_local() function. You will notice that this function uses /24 to differentiate subnets where the rest of tor uses /16 (including documentation of EnforceDistinctSubnets). Ticket #40009 has been opened for that. But that the moment, the function keeps looking at /24. Part of #33233 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/app/config/resolve_addr.h')
-rw-r--r--src/app/config/resolve_addr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/app/config/resolve_addr.h b/src/app/config/resolve_addr.h
index 17e9402033..f435ab29a4 100644
--- a/src/app/config/resolve_addr.h
+++ b/src/app/config/resolve_addr.h
@@ -22,7 +22,7 @@ bool find_my_address(const or_options_t *options, int family,
void resolved_addr_get_last(int family, tor_addr_t *addr_out);
void resolved_addr_reset_last(int family);
-MOCK_DECL(int, is_local_addr, (const tor_addr_t *addr));
+MOCK_DECL(bool, resolved_addr_is_local, (const tor_addr_t *addr));
#ifdef RESOLVE_ADDR_PRIVATE