aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-12-30 12:07:28 -0500
committerNick Mathewson <nickm@torproject.org>2014-12-30 12:07:39 -0500
commitac632a784cdeecaef81e5f1fe45a20f43a93aea7 (patch)
treead86d7845b6bc27dfc7b8ee9f7ac3849cbe3fed4 /src/or/rendservice.c
parentf2e4423bd2bf684849c968ff6bb19dfc3ee7d788 (diff)
downloadtor-ac632a784cdeecaef81e5f1fe45a20f43a93aea7.tar.gz
tor-ac632a784cdeecaef81e5f1fe45a20f43a93aea7.zip
Coalesce v0 and v1 fields of rend_intro_cell_t
This saves a tiny bit of code, and makes a longstanding coverity false positive go away.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 196145e210..d4fbe739fe 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1527,8 +1527,7 @@ find_rp_for_intro(const rend_intro_cell_t *intro,
}
if (intro->version == 0 || intro->version == 1) {
- if (intro->version == 1) rp_nickname = (const char *)(intro->u.v1.rp);
- else rp_nickname = (const char *)(intro->u.v0.rp);
+ rp_nickname = (const char *)(intro->u.v0_v1.rp);
node = node_get_by_nickname(rp_nickname, 0);
if (!node) {
@@ -1777,11 +1776,7 @@ rend_service_parse_intro_for_v0_or_v1(
goto err;
}
- if (intro->version == 1) {
- memcpy(intro->u.v1.rp, rp_nickname, endptr - rp_nickname + 1);
- } else {
- memcpy(intro->u.v0.rp, rp_nickname, endptr - rp_nickname + 1);
- }
+ memcpy(intro->u.v0_v1.rp, rp_nickname, endptr - rp_nickname + 1);
return ver_specific_len;