diff options
author | Andrea Shepard <andrea@torproject.org> | 2014-01-23 04:52:59 -0800 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2014-09-30 23:14:24 -0700 |
commit | 3bc7108d2cfb6795f1beb0f5dbb3ab66fe1601d3 (patch) | |
tree | ed2fb596810516e2857bd112cafa04fdd5aa2b0a | |
parent | 50d5fb87bd6e763895eb0a784e4dbb40a132b759 (diff) | |
download | tor-3bc7108d2cfb6795f1beb0f5dbb3ab66fe1601d3.tar.gz tor-3bc7108d2cfb6795f1beb0f5dbb3ab66fe1601d3.zip |
Make is_local_addr() mockable
-rw-r--r-- | src/or/config.c | 4 | ||||
-rw-r--r-- | 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 4ae9fadfeb..86d7c6e502 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 8a1919c2ed..bf176a6860 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 |