aboutsummaryrefslogtreecommitdiff
path: root/src/or/cpuworker.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-03-02 19:15:05 +0000
committerNick Mathewson <nickm@torproject.org>2009-03-02 19:15:05 +0000
commit9f8d095e0fa66dfa5087d5d23028b5caa3a87989 (patch)
tree25a414ab2b342e34f3aff851e76a358269ec40a8 /src/or/cpuworker.c
parentaa154d846afaf38efeaf44bc55af6fc26bb180bd (diff)
downloadtor-9f8d095e0fa66dfa5087d5d23028b5caa3a87989.tar
tor-9f8d095e0fa66dfa5087d5d23028b5caa3a87989.tar.gz
Add and use set/get_uint64 on onion tags. [bug 604; backportable]
It seems that 64-bit Sparc Solaris demands 64-bit-aligned access to uint64_t, but does not 64-bit-align the stack-allocated char array we use for cpuworker tags. So this patch adds a set/get_uint64 pair, and uses them to access the conn_id field in the tag. svn:r18743
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r--src/or/cpuworker.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 88a72886e..99e06df35 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -63,8 +63,8 @@ static void
tag_pack(char *tag, uint64_t conn_id, circid_t circ_id)
{
/*XXXX RETHINK THIS WHOLE MESS !!!! !NM NM NM NM*/
- *(uint64_t *)tag = conn_id;
- *(uint16_t *)(tag+8) = circ_id;
+ set_uint64(tag, conn_id);
+ set_uint16(tag+8, circ_id);
}
/** Unpack <b>tag</b> into addr, port, and circ_id.
@@ -72,8 +72,8 @@ tag_pack(char *tag, uint64_t conn_id, circid_t circ_id)
static void
tag_unpack(const char *tag, uint64_t *conn_id, circid_t *circ_id)
{
- *conn_id = *(const uint64_t *)tag;
- *circ_id = *(const uint16_t *)(tag+8);
+ *conn_id = get_uint64(tag);
+ *circ_id = get_uint16(tag+8);
}
/** Called when the onion key has changed and we need to spawn new