aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_client.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-15 08:34:30 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-15 08:34:30 -0400
commit44ee5037eacd2e39b0df7515b2ca0996c3372827 (patch)
tree3bdf8ac061fc5638024ee7df59708b2ebfa99315 /src/test/test_hs_client.c
parent5cc80692b8397d8b87fd69d0f0165a6156534f0b (diff)
downloadtor-44ee5037eacd2e39b0df7515b2ca0996c3372827.tar.gz
tor-44ee5037eacd2e39b0df7515b2ca0996c3372827.zip
fixup! test: Add HS v3 client-side test for picking intro points
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_client.c')
-rw-r--r--src/test/test_hs_client.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c
index 125a14e5d2..16b2d604fd 100644
--- a/src/test/test_hs_client.c
+++ b/src/test/test_hs_client.c
@@ -433,11 +433,15 @@ test_client_pick_intro(void *arg)
hs_desc_intro_point_t *, ip) {
extend_info_t *intro_ei = desc_intro_point_to_extend_info(ip);
if (intro_ei) {
- char *ip_addr = tor_addr_to_str_dup(&intro_ei->addr);
- tor_assert(ip_addr);
- ret =routerset_parse(get_options_mutable()->ExcludeNodes, ip_addr, "");
+ const char *ptr;
+ char ip_addr[TOR_ADDR_BUF_LEN];
+ /* We need to decorate in case it is an IPv6 else routerset_parse()
+ * doesn't like it. */
+ ptr = tor_addr_to_str(ip_addr, &intro_ei->addr, sizeof(ip_addr), 1);
+ tt_assert(ptr == ip_addr);
+ ret = routerset_parse(get_options_mutable()->ExcludeNodes,
+ ip_addr, "");
tt_int_op(ret, OP_EQ, 0);
- tor_free(ip_addr);
extend_info_free(intro_ei);
}
} SMARTLIST_FOREACH_END(ip);