summaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-11-12 14:41:44 +0000
committerNick Mathewson <nickm@torproject.org>2008-11-12 14:41:44 +0000
commitc36ddcbabf60df9f26ece0777766defd7fee751f (patch)
tree0ec657cbb0b90a629b417a5379f77372a230d8bb /src/or/connection_or.c
parenta790a13705e9d838a4092435ed981179054c6beb (diff)
downloadtor-c36ddcbabf60df9f26ece0777766defd7fee751f.tar.gz
tor-c36ddcbabf60df9f26ece0777766defd7fee751f.zip
Apparently sparc64 is way more strict about uint16_t access alignment than I had thought: it gave bus errors when messing with var-cell headers. Maybe this patch will fix bug 862.
svn:r17262
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 5797e5ea16..40dab3e4f0 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -157,8 +157,8 @@ cell_unpack(cell_t *dest, const char *src)
void
var_cell_pack_header(const var_cell_t *cell, char *hdr_out)
{
- *(uint16_t*)(hdr_out) = htons(cell->circ_id);
- *(uint8_t*)(hdr_out+2) = cell->command;
+ set_uint16(hdr_out, htons(cell->circ_id));
+ set_uint8(hdr_out+2, cell->command);
set_uint16(hdr_out+3, htons(cell->payload_len));
}