diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-26 10:36:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-26 10:36:49 -0400 |
commit | 1d44ac9acd6264141615b5fce6d537544dc6f52e (patch) | |
tree | d945147e0593271bcc77a34f048c937cb3087b9b /src/feature/nodelist | |
parent | efeb101b968fe6604ff97604afe527a36b94cfc9 (diff) | |
download | tor-1d44ac9acd6264141615b5fce6d537544dc6f52e.tar.gz tor-1d44ac9acd6264141615b5fce6d537544dc6f52e.zip |
Make nodelist_get_list() return a const pointer.
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r-- | src/feature/nodelist/nodelist.c | 4 | ||||
-rw-r--r-- | src/feature/nodelist/nodelist.h | 2 | ||||
-rw-r--r-- | src/feature/nodelist/routerset.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/feature/nodelist/nodelist.c b/src/feature/nodelist/nodelist.c index f878d47fd7..8aa4915107 100644 --- a/src/feature/nodelist/nodelist.c +++ b/src/feature/nodelist/nodelist.c @@ -944,7 +944,7 @@ nodelist_ensure_freshness(networkstatus_t *ns) /** Return a list of a node_t * for every node we know about. The caller * MUST NOT modify the list. (You can set and clear flags in the nodes if * you must, but you must not add or remove nodes.) */ -MOCK_IMPL(smartlist_t *, +MOCK_IMPL(const smartlist_t *, nodelist_get_list,(void)) { init_nodelist(); @@ -1939,7 +1939,7 @@ node_set_country(node_t *node) void nodelist_refresh_countries(void) { - smartlist_t *nodes = nodelist_get_list(); + const smartlist_t *nodes = nodelist_get_list(); SMARTLIST_FOREACH(nodes, node_t *, node, node_set_country(node)); } diff --git a/src/feature/nodelist/nodelist.h b/src/feature/nodelist/nodelist.h index a3d65347a8..84ab5f7a54 100644 --- a/src/feature/nodelist/nodelist.h +++ b/src/feature/nodelist/nodelist.h @@ -101,7 +101,7 @@ const struct curve25519_public_key_t *node_get_curve25519_onion_key( const node_t *node); crypto_pk_t *node_get_rsa_onion_key(const node_t *node); -MOCK_DECL(smartlist_t *, nodelist_get_list, (void)); +MOCK_DECL(const smartlist_t *, nodelist_get_list, (void)); /* Temporary during transition to multiple addresses. */ void node_get_addr(const node_t *node, tor_addr_t *addr_out); diff --git a/src/feature/nodelist/routerset.c b/src/feature/nodelist/routerset.c index 55e2756959..e801fd81b1 100644 --- a/src/feature/nodelist/routerset.c +++ b/src/feature/nodelist/routerset.c @@ -378,7 +378,7 @@ routerset_get_all_nodes(smartlist_t *out, const routerset_t *routerset, } else { /* We need to iterate over the routerlist to get all the ones of the * right kind. */ - smartlist_t *nodes = nodelist_get_list(); + const smartlist_t *nodes = nodelist_get_list(); SMARTLIST_FOREACH(nodes, const node_t *, node, { if (running_only && !node->is_running) continue; |