[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Make is_local_addr() mockable
commit 3bc7108d2cfb6795f1beb0f5dbb3ab66fe1601d3
Author: Andrea Shepard <andrea@xxxxxxxxxxxxxx>
Date: Thu Jan 23 04:52:59 2014 -0800
Make is_local_addr() mockable
---
src/or/config.c | 4 ++--
src/or/config.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/or/config.c b/src/or/config.c
index 4ae9fad..86d7c6e 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2259,8 +2259,8 @@ resolve_my_address(int warn_severity, const or_options_t *options,
/** Return true iff <b>addr</b> is judged to be on the same network as us, or
* on a private network.
*/
-int
-is_local_addr(const tor_addr_t *addr)
+MOCK_IMPL(int,
+is_local_addr, (const tor_addr_t *addr))
{
if (tor_addr_is_internal(addr, 0))
return 1;
diff --git a/src/or/config.h b/src/or/config.h
index 8a1919c..bf176a6 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -32,7 +32,7 @@ uint32_t get_last_resolved_addr(void);
int resolve_my_address(int warn_severity, const or_options_t *options,
uint32_t *addr_out,
const char **method_out, char **hostname_out);
-int is_local_addr(const tor_addr_t *addr);
+MOCK_DECL(int, is_local_addr, (const tor_addr_t *addr));
void options_init(or_options_t *options);
#define OPTIONS_DUMP_MINIMAL 1
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits